|
From: sfeam (E. Merritt) <eam...@gm...> - 2012-09-09 21:50:20
|
On Sunday, 09 September 2012, Daniel J Sebald wrote: > This morning I came to wonder, What if one wants one end of the range > fixed while the other is autoscaled? So I tried a few things, and the > results certainly aren't intuitive, or are buggy. > > Say, for example, my intention is to make a plot for which the left side > starts at x=30 and is autoscaled on the right side. I try > > gnuplot> plot [30:*] x > > and get something very unexpected, unless I really think about it. Autoscaling doesn't have an obvious meaning for function plots. Normally that command would be followed by 'plot <datafile>', with the meaning that points with x<30 would not be plotted. > First, the result is reversed, slightly unexpected. Then I wonder, 10 > is the "upper" range? OK, now I see. If I were to "plot x", the lower > range is 0 and upper range 10 by definition. Not quite. The default range for function plots is [-10:10] > So that is where the > reverse axis is coming from. That means if one does > > gnuplot> plot [3:*] x > > it comes out non-reversed. And yes that is the result. OK, perhaps > gnuplot should be changed so that the upper limit is "rangemin + 10", > and the symmetric case "rangemax - 10". > > Out of curiosity I try > > gnuplot> set xrange [3:*] reverse > gnuplot> plot x > > and the graph changes. However, > > gnuplot> set xrange [30:*] noreverse > gnuplot> plot x > gnuplot> set xrange [30:*] reverse > gnuplot> plot x > > brings no change in the graph. Perhaps that is just a ramification of > the "rangemin + 10" issue. > > So, I wonder how I can get better control of the range settings and > achieve the initial goal of left end of plot fixed at thirty and the > right end autoadjust. How about > > gnuplot> plot [30:40<*] x None of the above test commands make sense, IMHO. Function plots require a complete range specifier. I'd be in favor of giving an error message in each of those cases. That is, disallow '*' in the range specifier for function plots. <aside> As you probably recall, my opinion is that a range specifier in the plot command is always a bad idea. If it were just me, I'd remove that option altogether. The only reason I can see to allow it is if it is changed so that the in-line range applies only to the immediately following plot clause. That way you could get separate ranges for separate plots: plot [10:20] f1(x), [20:30] f2(x), [30:100] f3(x) I don't really like that either, but at least it would provide a capability that isn't addressed by simply doing "set xrange" first. </aside> > I would think that "reverse" could > be viewed as "do all the range computations, then when all done reverse > the range". That is indeed what it now means. At least that's the intent. Do you have an example that works otherwise? > In any case, I have a patch all set for Octave to address the proposed > mod in 4.7 beta, but I'm reluctant to apply it until 4.7 becomes an > official release. Perhaps we could address the bugs I described above > with the current proposed 4.7 behavior in mind and then reassess how > one-side-autoadjust works. That is, fix things so that: > > [a:*] - The autoadjust value * is greater than a > [*:b] - The autoadjust value * is less than b That's what it does now in 4.7, at least for me. Again, do you have an example of data-driven autoscaling that gives some other result? |