added support to write figures as eps and tiff