function saveplot(filename,optargs) % SAVEPLOT - Save current plot to disk in a PostScript file. % This version is compatible only with Octave. % In Matlab, just say 'print -deps[c] filename'. % *** MULTIPLOT MODE NOT SUPPORTED *** % (only get last plot) if (nargin<2), optargs = ''; end; % optargs to consider: % landscape % color % solid % "<fontname>" <fontsize> % lw <width> [default = 1.0] gset terminal push gset nomultiplot % can't set out terminal in multiplot mode %gset terminal fig % in this output format, you can edit it! cmd=['gset terminal postscript eps monochrome enhanced',... optargs]; eval(cmd); disp(sprintf('Writing current plot to %s',filename)); cmd = sprintf('gset output \'%s\';',filename); eval(cmd); replot % remultiplot -- does not yet exist in gnuplot closeplot gset terminal pop |
function saveplot(filename) % SAVEPLOT - Save current plot to disk in a PostScript file. % This version is compatible only with Matlab. cmd = ['print -deps ',filename]; % for color, use '-depsc' disp(cmd); eval(cmd); |