0001 function VMT_ExportFIG(savepath,to_export,BkgdColor,AxColor,FigColor,FntSize,Res,Format)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 hf = figure(findobj('name',to_export));
0017 figure(hf);
0018 set(gcf, 'PaperPositionMode', 'auto');
0019 box on
0020 if ~isempty(BkgdColor)
0021 set(gcf,'Color',BkgdColor);
0022 end
0023
0024 if ~isempty(FntSize)
0025 set(gca,'FontSize',FntSize)
0026 set(get(gca,'Title'),'FontSize',FntSize)
0027 end
0028
0029 if ~isempty(FigColor)
0030 set(gca,'Color',FigColor)
0031 end
0032
0033 if ~isempty(AxColor)
0034 set(gca,'XColor',AxColor)
0035 set(gca,'YColor',AxColor)
0036 set(gca,'ZColor',AxColor)
0037 set(findobj(gcf,'tag','Colorbar'),'FontSize',FntSize,'XColor',AxColor,'YColor',AxColor);
0038 set(get(gca,'Title'),'FontSize',FntSize,'Color',AxColor)
0039 set(get(gca,'xLabel'),'FontSize',FntSize,'Color',AxColor)
0040 set(get(gca,'yLabel'),'FontSize',FntSize,'Color',AxColor)
0041 end
0042
0043 set(gcf,'InvertHardCopy','off')
0044
0045
0046
0047 switch Format
0048 case 'png'
0049 [file,pathname] = uiputfile('*.png',[to_export ' Export'],savepath);
0050 fileout = [pathname file];
0051
0052
0053 set(gcf, 'PaperPositionMode', 'auto');
0054 print(hf,'-dpng', '-noui', '-painters',['-r' num2str(Res)],fileout)
0055 case 'eps'
0056 [file,pathname] = uiputfile('*.eps',[to_export ' Export'],savepath);
0057 fileout = [pathname file];
0058
0059
0060 set(gcf, 'PaperPositionMode', 'auto');
0061 print(hf,'-depsc', '-noui', '-painters',['-r' num2str(Res)],fileout)
0062
0063 otherwise
0064 [file,pathname] = uiputfile('*.png',[to_export ' Export'],savepath);
0065 fileout = [pathname file];
0066
0067
0068 set(gcf, 'PaperPositionMode', 'auto');
0069 print(hf,'-dpng', '-noui', '-painters',['-r' num2str(Res)],fileout)
0070 end
0071
0072
0073
0074
0075
0076