Save current figure to different format By J. Decker <jodecker@mit.edu> and Y. Peysson <yves.peysson@cea.fr>
0001 function [] = savefig_dke_yp(figname,dirfig) 0002 % 0003 % Save current figure to different format 0004 % 0005 % By J. Decker <jodecker@mit.edu> and Y. Peysson <yves.peysson@cea.fr> 0006 % 0007 if nargin == 1, 0008 dirfig = ''; 0009 end 0010 if isempty(dirfig),%local saving 0011 eval(['print -depsc -loose -tiff -r600 ',figname,'.eps']) 0012 saveas(gcf,figname,'fig') 0013 else 0014 if ~exist(dirfig),%Create directory for figures 0015 mkdir(dirfig); 0016 end 0017 % 0018 dir_old = pwd; 0019 cd(dirfig) 0020 eval(['print -depsc -loose -tiff -r600 ',figname,'.eps']) 0021 saveas(gcf,figname,'fig') 0022 cd(dir_old) 0023 end 0024 0025