|
From: <pl...@pi...> - 2012-11-10 21:54:45
|
On 11/10/12 20:03, sfeam (Ethan Merritt) wrote:
> 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.
No. That was the output from "show all" command, showing what gnuplot
had selected automatically.
All my commands were as indicated by the prompts.
>
>>
>> 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"?
" autoscale button (wxt)" is the button in wxt terminal with the hover
hint "Apply autoscale".
>
>> 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.
No, that's not what I meant to say, but it would be accurate to say that
I was not prompted to re-enter the data.
>
>> 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.
The problem I was seeing here was not that I wanted to resample the
funtion but that when it did so, it was not in a consistent way with the
initial plot command.
Because the data was [-50:50] the function was plotted over the same
range as the data and autoscale (during the initial plot command)
created [-60:60] xrange.
Recalculation of the grid, implicit as result of the scoll, then caused
the function to be plotted over the full [-60:60] xrange.
This was a) inconsistent; b) problematic since the function was
ill-defined outside the intended range and was not suitable to be plotted.
It seems untidy and unhelpful that , when I do the smallest scroll,
functions get plotted over a different range and the grid starts jumping
about and changing the tic internal.
I would expect a scroll operation to do no more than move what I have
and fill in the gaps.
Peter.
>
> 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
>
>
|