|
From: Tait <gnu...@t4...> - 2012-09-11 03:52:52
|
> >>> <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.
I like the idea of separating axis range from (data/function) plot range.
It's a somewhat frequently-asked question how to use a different range for
a function than what is used for the axis, and the current solution -- to
use a ternary -- isn't especially elegant.
As suggested, it would then become natural to allow "set xrange reversed"
by itself.
> 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?
What you're asking about is GPVAL_X_MAX, which is not the same as the
xrange. If you were to continue by plotting another data set that
extended to 22, then you would rightly expect to (and gnuplot would)
scale to the new x-max of 22. The possibility to have the autoscale
performed only on the first plot, then locked into place is supported
by the "writeback" option.
I don't normally use writeback, but in trying it just now, it appears to
be broken. Both "set xrange [9:*] writeback" and "set xrange [*:*]
writeback" followed by the plot above fail to write the range back as
they should. It's left auto-scaled.
(And if we support "set xrange [no]reverse" we should likewise support
"set xrange [no]writeback".)
|