From help-octave-request at bevo dot che dot wisc dot edu Thu Jan 22 16:33:58 2004 Subject: Re: Setting plot ranges From: geordie dot mcbain at aeromech dot usyd dot edu dot au To: Joe Koski , Octave_post Date: Fri, 23 Jan 2004 09:25:43 +1100 It's not pretty, but compare: -*- y = x = (0:100)'; y(end) *= 100; plot (x,y); -*- and -*- x = (0:100)'; y(end) *= 100; Ymax = 2*mean (y); graw (sprintf ("set yrange [0:%g]\n", Ymax)); plot (x, y); -*- On Fri, 23 Jan 2004 08:35 am, Joe Koski wrote: > In a recent exercise, because of some extreme "outliers," I needed to > override the vertical axis of a plot with gset yrange. I had been entering > this range "manually" e. g., gset yrange [0:10], but the scale varied from > plot to plot, so I decided to automate the process by calculating a maximum > that filtered out the extreme values. > > It appears that you can't enter a real (or string) variable such as > > Ymax = 2.0*mean(y); > S_Ymax = num2str(Ymax); > > into the gset yrange [0:Ymax] or gset yrange [0:S_Ymax] command. Octave > just tells me that Ymax or S_Ymax are undefined. > > Is there trick to doing this, or must plot ranges be entered only > numerically, without the use of variable names? > > Thanks for the advice. > > Joe Koski > > > > ------------------------------------------------------------- > 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 > ------------------------------------------------------------- ------------------------------------------------------------- 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 -------------------------------------------------------------