tfigure_save_multiformat.m - cosmo - front and backend for Markov-Chain Monte C… | |
git clone git://src.adamsgaard.dk/cosmo | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
tfigure_save_multiformat.m (513B) | |
--- | |
1 function figure_save_multiformat(fig, basename, formats) | |
2 | |
3 %% figure_save_multiformat.m | |
4 % save a figure in multiple formats with a single function call. | |
5 % Example: | |
6 % figure_save_multiformat(gcf, 'first_plot', ['fig', 'png', 'pdf']) | |
7 | |
8 for i=1:length(formats) | |
9 format = formats(i); | |
10 if strcmp(format, 'fig') | |
11 %savefig(fig, strcat(basename, '.fig'), '-v7.3'); | |
12 savefig(fig, strcat(basename, '.fig'), 'compact'); | |
13 else | |
14 print(fig, basename, strcat('-d', cell2mat(format))); | |
15 end | |
16 |