From help-request at octave dot org Wed Dec 28 06:32:10 2005 Subject: Re: question about multiple plots From: Johan Kullstam To: "Steven Thijs" Cc: Date: 28 Dec 2005 07:30:12 -0500 "Steven Thijs" writes: > Hi, > > > > I'm running octave for windows. > > Is it possible to plot multiple figures? > > I try to use the command: figure (2) for example, > > but this just returns 2, instead of opening a new figure. I like to send all my plots to a postscript file (I use the same name "/tmp/octplot.ps" in linux, but in windows you can use "c:/temp/octplot.ps" or somesuch). Then I use ghostview to look at the plots. This way I can plot many figures and not clutter up my screen with a gazillion windows. I can also print all figures or selected ones from ghostview. Also, it is easy to copy the figures to another file and then view it to run side-by-side comparisons on the screen. In an octave script, I do iplotlps plot(...) closeplot purge_tmp_files off to the side, run gv /tmp/octplot.ps. Hope this helps. This function initializes my plots function fn = iplotlps(fn, t) ##IPLOTLPS ## ## Initialize PLOT for Landscape PostScript __gnuplot_raw__ "reset\n"; # reset gnuplot purge_tmp_files; # clean up /tmp if nargin < 1, fn = "/tmp/octplot.ps"; endif if nargin < 2, t = 1; endif if t [str,err,msg] = stat(fn); if err == 0, ##fprintf("unlinking %s\n", fn); unlink(fn); endif endif __gnuplot_set__ term post landscape enhanced color solid "Palatino-Roman" 14 cmd = sprintf("__gnuplot_set__ output \"%s\"", fn); eval(cmd); __gnuplot_set__ data style lines __gnuplot_set__ grid ## globals global plot_file_fmt global plot_count plot_file_fmt = []; plot_count = -1; endfunction -- Johan KULLSTAM ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------