From: Ethan A M. <me...@uw...> - 2020-09-13 23:32:13
|
On Sunday, 13 September 2020 13:17:59 PDT Dima Kogan wrote: > Hi. I do observe your sequence work at you state: > > > 1) start gnuplot > > 2) load script > > 3) zoom > > 4) 'u' > > plot is now incorrectly scaled > > 5) 'n' > > shows zoom state from (3) > > 6) 'p' > > correctly unzooms to original plot > > Step 6 may be 'u' or 'p'. The reason things don't look the same after > steps 4 and 6 is the value of > > { axis_array[FIRST_Y_AXIS].min, axis_array[FIRST_Y_AXIS].max } > > at the start of the refresh_bounds() call. This function assumes > min<max. And if we're reversing some axis, this is done at the very end > of refresh_bounds() with the axis_check_range() calls. > > In step 3, refresh_bounds() sees {min,max} = {4000,-500} > In step 6, refresh_bounds() sees {min,max} = {1850,1400} > > This is dependent on the actual zoom bounds. Both of these have the > unexpected min>max, obviously, but in step 6 we get lucky, and it ends > up doing the right thing anyway, in this case. OK. But no autoscaling at all should be necessary during zoom or unzoom. That is true even for nonvolatile data, but is doubly true for volatile data. The whole point of zoom is that the bounds are being chosen interactively by the mouse, not by the content of the plot. My thought is to add a flag somewhere that zoom/unzoom is in progress, and skip all autoscaling operations if it is set. In fact there already is a flag "inside_zoom" but it isn't used for much. I have not yet inventoried all the places in the code that would need to be changed. Ethan |