From help-request at octave dot org Mon Jun 13 10:17:46 2005 Subject: Re: Plotting data into file From: Joan Picanyol i Puig To: help at octave dot org Date: Mon, 13 Jun 2005 17:14:41 +0200 * Michael Kopp [20050613 16:59]: > I am about writing a script which automatically plots data into > eps-files. I am using "gset outpout " to designate the output > file. However, this seems to work only if I give the name ouf the > outputfile directly as a string, but not if I give it as an octave > string variable. Here is an example: > > str = "test.eps"; > gset terminal postscript eps; > gset output str; % this does not work > plot((1:10)', (1:10)'/2); > gset output "anothertest.eps"; % this works > plot((1:10)', (1:10)'/2); > gset terminal X11; > gset output; > > Any suggestions? Try sprintf + graw, i.e. (long line): graw (sprintf("set output \"plots/png/simulacions_previes-v%d-b%d-n%d-f%1d.png\"\n",v, beta*10, noise, fading)); Nowadays I'd try sprintf + print though. qvb -- pica ------------------------------------------------------------- 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 -------------------------------------------------------------