From: Petr M. <mi...@ph...> - 2012-09-25 07:37:41
|
>> 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. I see, my findings are exactly opposite :-) >>> 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). I meant the vertical scrolling in 2d graphs - zoom (around mouse cursor) is more useful. > 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. That's the 'u' hotkey: u = unzoom a = autoscale p = previous n = next --- Petr |