From help-octave-request at bevo dot che dot wisc dot edu Thu Jan 8 08:20:56 2004 Subject: gset output-command From: Michel To: Octave-help Date: Thu, 08 Jan 2004 15:24:47 +0100 Hey, I'm trying to write a simple m-file with wich I can save plots (also if I rotated them). It works, but I can't seem to use a string-variable for teh file-name?? Can't I specify a variable? Is it just passed on to gnuplot? gset output filename It's not good code :), but here it is: #saveplot saves the last plot in the current directory with filename "filename" # in postscript-format function saveplot graw("save \'.plot.current\';") gset terminal postscript gset output "plot.ps" graw("load \'.plot.current\';") gshow gset terminal x11 endfunction If somebody wants to enhance it ..be my guest. I'll maybe do it while I'm using it. thinking of creating tempfile or maybe none at all and specifyinh the output-format and specifying the filename as a parameter!!! I think it also saves multiple plots ... so this is not rerally correct to, but it works enough for me at the moment... ------------------------------------------------------------- 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 -------------------------------------------------------------