3 % To manage the saving of figures. Save in eps, jpg and png format.
6 % issave:
boolean. If
true saving figure is done.
7 % Name: name of the destination file without extension (
string)
8 % percent: value
for resizing the figure (only png format under unix)
11 % OptFEM2DP1 [V1.2b1] - Copyright (C) 2013 CJS (LAGA)
13 % This file is part of OptFEM2DP1.
14 % OptFEM2DP1 is free software: you can redistribute it and/or modify
15 % it under the terms of the GNU General Public License as published by
16 % the Free Software Foundation, either version 3 of the License, or
17 % (at your option) any later version.
19 % OptFEM2DP1 is distributed in the hope that it will be useful,
20 % but WITHOUT ANY WARRANTY; without even the implied warranty of
21 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 % GNU General Public License
for more details.
24 % You should have received a copy of the GNU General Public License
25 % along with
this program. If not, see <http:
27 [SUCCESS,MESSAGE,MESSAGEID] = mkdir(
'images');
28 eval(sprintf(
'print -depsc2 images/%s.eps',Name))
29 fprintf(' -> save figure(%d) in images/%s.eps\n',gcf,Name);
30 eval(sprintf('print -djpeg90 images/%s.jpg',Name))
31 fprintf(' -> save figure(%d) in images/%s.jpg\n',gcf,Name);
33 system(sprintf('convert -resize %d%% images/%s.eps images/%s.png',percent,Name,Name));
34 fprintf(' -> save figure(%d) in images/%s.png (resize %d%%)\n',gcf,Name,percent);
36 eval(sprintf('print -dpng images/%s.png',Name))
37 fprintf(' -> save figure(%d) in images/%s.png \n',gcf,Name);