From: Mojca M. <moj...@gm...> - 2012-09-25 06:35:39
|
On Tue, Sep 25, 2012 at 8:07 AM, Petr Mikulik wrote: >> I'm curious whether I'm the only one experiencing this problem or if >> this appears to be "a feature" rather than a bug in the eyes of >> developers. >> >> If I use >> plot [0:] 'datafile.dat' ... >> then I'm unable to zoom into the desired region of a plot with a mouse >> by selecting the desired rectangle. It zooms properly to the y axis >> and (usually) to the right of x axis, but the left of x axis always >> stays at zero which is a bit annoying. > > This does neither work by design: > gnuplot> plot [1:10] sin(x)/x > gnuplot> set xrange [5:8]; replot > > So why do you use plot [x1:x2] instead of set xrange [x1:x2]? I find plot [x1:] more intuitive, shorter, one command less to write and faster to change from one command to the other. > Anayway, Ethan has recently pushed a patch for 4.7 that allows zooming in > both axes even if you explicitly disable it via plot [] [] I wasn't aware of that. Thanks to both for pointing it out. I'll test and report. I usually use the trunk version, but I was playing with 4.6 branch. >> Also, the mouse movement (moving wheel to left & right) which usually >> moves the graph to left & right is now zooming in & out instead of >> moving the graph. > > Wheel left and right? Do you have a trackball? I thought it works just as > mouse upside-down. I have a trackpad (http://www.apple.com/magictrackpad/). > The zooming in-out by +/- hotkeys and mouse wheel up/down implements my > patch > [ gnuplot-Patches-3537423 ] zoom by mouse wheel and hotkeys > but it's not yet in sources so you have probably applied it yourself. No, I didn't apply any patch (even though I still want to test your patch more extensively) - I was using 4.6 stable branch. In X11 the usual mouse wheel is sending out buttons 4 and 5 for scrolling up and down, while 6 and 7 are for scrolling left and right. In wxt the following code moves left & right for example: mouse_button = (event.GetWheelRotation() > 0 ? 4 : 5); #if wxCHECK_VERSION(2, 9, 0) /* GetWheelAxis: 0 is the Y axis, 1 is the X axis. */ if (event.GetWheelAxis() > 0) mouse_button += 2; #endif wxt_exec_event(GE_buttonpress, x, y, mouse_button, 0, this->GetId()); > The patch needs some testing ... because people using mouse with wheel like > zoom-in/out but people using touchpad expect scrolling instead Yes, exactly. I can use another "mouse gesture" to zoom in and out. > (even though it is rather useless for 2d graphs). Scrolling left and right is not useless for 2d graphs (maybe scrolling up and down is way less usable, but left and right is handy). But then I admit that it is kind of useless in gnuplot which reads and recalculates the data over and over again for every few pixels I want to scroll. Scrolling is actually prohibitively slow. If I have 1000 points on the graph, I don't need scrolling. But when I have 1-10 million points, I can basically forget about scrolling. (Also, qt is prohibitively slow and totally confusing when resizing the plot. When I want to resize the window to fill almost full screen, Qt probably sends a couple of hundred "resize events" and gnuplot has to recalculate the whole plot about a few hundred times. X11 basically waits until I completely resize the window and draws some nonsense below [copies of original image] and only redraws the graphic once or twice, not hundred times.) Slightly off-topic: what is the magic key combination (or another trick) to restore the original x and y range (the one set before moving & zooming the graph with the mouse)? I'm now using "p" key, but that takes forever to get back to the initial range. Mojca |