|
From: Daniel J S. <dan...@ie...> - 2012-09-11 00:02:13
|
On 09/10/2012 05:34 PM, Ethan A Merritt wrote: > On Monday, September 10, 2012 01:16:41 pm Daniel J Sebald wrote: >>> <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> >> >> Yes, I sort of agree with that. That is why I picked the phrasing that >> the range is associated with the data, not the orientation of the axis. >> Given the example you wrote, the paradigm is that [10:20] means the >> data for which x is between 10 and 20, and in that case [20:10] is no >> different than [10:20]. Using the range specifier to control the >> orientation of the plot in your example would be a mess. > > The way I view it is that "set xrange [FOO:BAZ]" means the left > end of the axis is pinned at FOO and the right end is pinned at BAZ. > The makes sense both externally (what the user sees) and internally > (mapping a numerical coordinate onto a screen position). > > I will note that my primary motivation for the change in 4.7 was to clean > up the code internally. The fact that it also IMHO makes a more sensible > user-visible syntax is just a side benefit. The change removed a > tangle of calls and macros like check_axis_reversed(), CHECK_REVERSE, > AXIS_ACTUAL_MIN, etc, and made it a lot easier to implement linked > primary/secondary axes. It also fixed corruption in the zoom/restore > state if the AXIS_REVERSE flag somehow got set while a plot was zoomed. That's good. There's a natural complexity to these sorts of things and controlling the range doesn't seem like it should be so complex. >> Anyway, the most affect on backward compatibility is >> ["reverse" only applies to the autoadjust settings] >> so I'm wondering why that change is preferred. > > The `reverse` keyword was added sometime between versions 3.5 and 3.7 > Its documentation has always said > `reverse` is intended primarily for use with `autoscale` Oh, then that was a bug when released. The "NB: This is a change introduced in version 4.7." comment in the xrange documentation suggests the old behavior was intentional. I have the fix for Octave ready to go then. > Dan, you are again showing tests with function plots. > I keep pointing out that the x-axis autoscaling commands, including the > * character in a "set xrange" command _do not apply_ to the samples generated > for functions. I am pretty sure that whatever result you get is pure > happenstance; it was not a deliberate design decision, and the use of * for > function domains was never documented because its use was not intended. I included the function x so that it illustrates the data points passing through the line and that things are working properly. Try without the function x and it is the same result. I'll do this with a bit more detail, and I will use 9 as a lower limit so as to rule out some strange conflict between the [-10:10] of the default range: G N U P L O T Version 4.7 patchlevel 0 last modified 2012-06-19 Build System: Linux x86_64 Copyright (C) 1986-1993, 1998, 2004, 2007-2012 Thomas Williams, Colin Kelley and many others gnuplot home: http://www.gnuplot.info mailing list: gnu...@li... faq, bugs, etc: type "help FAQ" immediate help: type "help" (plot window: hit 'h') Terminal type set to 'qt' gnuplot> show xrange set xrange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] ) gnuplot> set xrange [9:*] gnuplot> show xrange set xrange [ 9.00000 : * ] noreverse nowriteback # (currently [:10.0000] ) gnuplot> plot '-' input data ('e' ends) > 5 5 input data ('e' ends) > 8 8 input data ('e' ends) > 12 12 input data ('e' ends) > 15 15 input data ('e' ends) > e gnuplot> show xrange set xrange [ 9.00000 : * ] noreverse nowriteback # (currently [:15.0000] ) My plot is showing the xaxis starting at 9 and ending at 15. Shouldn't that be saying "currently [9.0000:15.0000]", because that is currently what the range is on the plot? Dan |