Write fig files