|
From: sfeam (E. Merritt) <eam...@gm...> - 2012-11-10 19:03:34
|
On Saturday, 10 November 2012, pl...@pi... wrote:
> Actually,I'm getting some very odd things happening here.
>
> Firstly , being still half asleep it typed in some data with commas and
> did not get what I intended (so not bug yet)
>
> gnuplot> f(x)=0
> gnuplot> plot "-" w l , f(x)
> input data ('e' ends) > -50,1
> input data ('e' ends) > 0, 1
> input data ('e' ends) > 50, -1
> input data ('e' ends) > e
>
> set xrange [ 0.00000 : 2.00000 ] noreverse nowriteback
> set yrange [ -60.0000 : 60.0000 ] noreverse nowriteback
OK. So you have set explicit ranges.
>
> Then I entered what I intended.
>
> gnuplot> plot "-" w l , f(x)
> input data ('e' ends) > -50 -1
> input data ('e' ends) > 0 1
> input data ('e' ends) > 50 -1
> input data ('e' ends) > e
>
>
> However , this did not rescale, I got what appeared to be two flat lines
> with the ranges still as shown above.
Yes.
> Then I hit the autoscale button (wxt) and got my triangular data line
What's an "autoscale button"? Do you mean the hot-key "a"?
> but the function f(x) was only plotted over its previous x extent of 0:2
> and was I tiny segment on the now correct ranges:
By default if you rescale/refresh a plot created from volatile
(cannot be re-read) data, then it uses the values already stored internally.
In your case this includes the function data sampled over the range [0:2].
> No amount of replot, rescale etc seems to correct this, so there is a
> difference of behaviour here for in line data rather than a file. (Can't
> re-read pipe I guess).
Yes, although actually an input pipe and a file act the same in this case.
It is the difference between "refresh", which re-uses the existing data,
and "replot" which goes back and reexecutes the previous plot command
including reading from the data sources. The program knows that it can't
re-read from "-" so it automatically tries to avoid "replot".
You can force the same behaviour for a data file or input pipe using
set datafile volatile
This can be useful for example if the data source is changing in realtime
but you want to zoom the currently visible display rather than
replacing it with new data.
Did you really mean to say that the "replot" command does not prompt you
to type in the data from "-" again? That would be a bug.
> So it seems that scolling , which implies setting an explicit range
> instead of auto, changes the way the function limits are determined.
No, or at least I don't think of it that way.
The hot-keys, scrolling, and rotation in 3D all try to use "refresh"
rather than "replot" to avoid triggering a full re-read of all input on
each event. For large input files or for substantial computation made on
the input values, this can make a huge difference in responsiveness.
And of course for input from the command line via "-" it is not possible
to reread.
You can always force a full "replot" including reevaluation of the
input data if you want to. That would also cause it to resample any
functions using the current active domain on X.
I suppose it might be reasonable to have "refresh" trigger resampling
of 2D functions. It would be computationally intensive in 3D, however,
and hammer the responsiveness of mouse interaction.
Ethan
|