From: Daniel J S. <dan...@ie...> - 2004-05-13 17:27:53
|
Hans-Bernhard Broeker wrote: >On Wed, 12 May 2004, Daniel J Sebald wrote: > > > >>Here is something odd in the latest CVS version. In the "using.dem" >>script, for the first plot, with the mouse active, zoom in on say a top >>middle third of the data. There will be some lines extending below the >>bottom border. The length of the lines seems to vary upon what area was >>zoomed. (That is, do this again and the line lengths may be shorter or >>longer by random.) >> >> > >'impulses' plots assume the plot has a baseline they can use. Zooming may >break that assumption. There have been problems like this with impulses >in the past. So yes, this is a bug, but not an entirely unexpected one. > I see what is happening now. Impulses should behave so that negative numbers have a line appearing below y=0. However, it appears that the current behavior does the same thing for *any* border that appears at the bottom of the plot. For example, say the bottom border is at y=15. A value of 17 in the original plot now has a line going from 15 to 17. A value of 14 in the original plot now has a line going from 14 to 15. For some reason, gnuplot thinks it can plot outside the bottom border. There shouldn't be lines below the border. Agreed? >>With the first plot still zoomed, go to the command line, hit return and >>go to the second plot. The second plot will be zoomed also. (Should it >>stay zoomed?) In the window, unzoom the second plot by typing 'u'. The >>ranges don't seem to be very nice. The image is small. The second plot >>script issues a >> >>set xrange [1:8] >> >>Is there a problem with setting the range when in zoomed mode? >> >> > >No. There's a more general problem in the way zooming, and especially the >'u'nzoom hotkey works. The general problem is that mouse interactions >change the global state of gnuplot settings. You can see that happening >by typing the '6' hotkey: each zooming operation modifies the global range >settings. > >In scripts like our demos, where all settings not explicitly changed >between plots are assumed to keep the values from the previous plot >command, that will break massively. Until we implement separate global >data sets for each plot, so the mousing code can work on a copy instead of >the single instance of all the settings we have, I don't think there's >much that can be done about that. > >Workaround: don't zoom in demos; or if you do, remember to unzoom _before_ >you proceed to the next plot. Using 'unzoom' on a different graph than the >one you zoomed on is IMHO begging for trouble. > So, when unzoomed in the second plot, the ranges go back to [*:*] or something like that. But why should the explicit set xrange [1:8] be discarded? Anyway, I don't see how the "each plot has its own settings" would change matters. If one plot is zoomed and then a second is generated, what will you use for the ranges of the second plot? You're still going to have this same scenario. What you are suggesting is useful for the situation where there are multiple plot windows and each has its own record of ranges, etc. However to solve this zoom settings across plots problem, it seems to me that the only requirement is that range sets from the command line and from the mouse be distinguishable. (But that currently may not be the case in Gnuplot.) It seems to me that you have to have the ability to distinguish where the range set originated from, otherwise a good solution can't be done. One possibility might be that an option be added to "set range" which stands for "temporary range set", e.g., set xrange [x_left:x_right] temp or maybe set xrange [x_left:x_right] replot which would mean that the range settings in this command only apply to replot and when a new plot command comes along, the original ranges are used, not the "temp" or "replot" ones. Also, with the new plot command, these "temp" or "replot" settings are changed to those ranges corresponding to "plot". That would mean internally, gnuplot has x_range_plot x_range_replot Any commands "replot" use the settings in x_range_replot. Any commands "plot" use x_range_plot. A "plot" command does x_range_replot = x_range_plot. "set xrange [:] replot" does x_range_replot = [:]. "set xrange [:]" does x_range_replot = x_range_plot = [:]. Thus, the mouse zoom could do a set xrange [:] replot set yrange [:] replot replot and not disturb the overall settings. >[... other problem...] > > >>strings would be shifted, the key would be in the wrong place. The next >>two or three plots showed the same thing, getting progressively worse. >> The problem then corrected itself and things worked fine again. I >>haven't been able to reproduce this. >> >> > >Well, next time you come across this, 'save' the state of the broken plot >then, before it disappears. > OK Dan |