From: Petr M. <mi...@ph...> - 2008-03-29 21:03:54
|
> Looking at this again , I wonder if it can be done with macros. > > It would be easy to bind something to "Left" (or whatever key is prefered) > but I dont see any exposed variables relating to the zoom window that > could be tweeked by a gnuplot command. I think I've sent a recipe how to do it. Anyway, here is a full implementation: # 4.2.x: use "replot" command # 4.3: use "refresh" command # Note: only for linear scale; for GPVAL_X_LOG!=0, do it accordingly DELTA_X(a)=a*(GPVAL_X_MAX-GPVAL_X_MIN)*0.5 DELTA_Y(a)=a*(GPVAL_Y_MAX-GPVAL_Y_MIN)*0.5 # enlarge limits independently: bind "Ctrl-Right" \ "set xrange [GPVAL_X_MIN+DELTA_X(1):GPVAL_X_MAX+DELTA_X(1)]; replot" bind "Ctrl-Left" \ "set xrange [GPVAL_X_MIN-DELTA_X(1):GPVAL_X_MAX-DELTA_X(1)]; replot" # scroll: bind "Right" "set xrange [GPVAL_X_MIN:GPVAL_X_MAX+DELTA_X(2)]; replot" bind "Left" "set xrange [GPVAL_X_MIN-DELTA_X(2):GPVAL_X_MAX]; replot" # squeeze limits independently: not needed, use zoom by mouse instead # enlarge limits independently: bind "Ctrl-Up" "set yrange [GPVAL_Y_MIN+DELTA_Y(1):GPVAL_Y_MAX+DELTA_Y(1)]; replot" bind "Ctrl-Down" "set yrange [GPVAL_Y_MIN-DELTA_Y(1):GPVAL_Y_MAX-DELTA_Y(1)]; replot" # scroll: bind "Up" "set yrange [GPVAL_Y_MIN:GPVAL_Y_MAX+DELTA_Y(2)]; replot" bind "Down" "set yrange [GPVAL_Y_MIN-DELTA_Y(2):GPVAL_Y_MAX]; replot" # squeeze limits independently: not needed, use zoom by mouse instead |