|
From: Maximilian F. <mx...@gm...> - 2008-01-25 19:44:39
|
On Jan 23, 2008 1:19 AM, Ethan Merritt <merritt@u.washington.edu> wrote:
> On Tuesday 22 January 2008 16:03, Maximilian Fabricius wrote:
> > Hi all,
> >
> > fist of all I apologize if this topic came up recently already.
> >
> > I love to use shell scripts for my work and to use gnuplot to present
> > intermediate results.
> > Now, it would be great if I could present a plot, let the user use all
> > the great interactive
> > features of the x11 terminal like zooming and continue my script only
> > after the user closed
> > the terminal. Alternatively if I could define a key - "q" for example
> > - which closes the current plot
> > and continues the gunplot script, that would be great.
>
> You have many such options.
> Please see the examples given with "help pause".
>
> In the CVS version of gnuplot you also have the option to bind
> an arbitrary command sequence to the event generated by closing
> the plot window:
>
> bind "close" "N=N+1; load 'plot'.N"
>
> That would load successive plots plot1 plot2 plot3 etc;
> each would display until the window was closed, then the next one would
> pop up in sequence.
>
> > Before I start digging through code, is there already a solution to
> > this?
>
> There are many solutions.
> As to focus or re-focus of the window to catch keystrokes,
> that is more a matter for your window manager than for gnuplot.
>
> --
> Ethan A Merritt
>
Ethan,
I followed the mouselabel example.
My actual plot script now calls another script:
pause mouse key
if (MOUSE_KEY != 27 && MOUSE_CHAR ne " ") reread
Still, if I do this I loose the interactive functionality of x11
(toggling logscale with l, unzooming on a etc.).
Of course I could try to re-enable all this in the pause-mouse-key-script.
pause mouse keypress
bind "ctrl-l" "lx=lx+1;if(lx%2)set logscale x; else unset logscale x"
if (MOUSE_KEY != 27 && MOUSE_CHAR ne " ") reread
(where lx is defined in the first script)
This did not work, though. Wouldn't it be easier to have an option
like "pause mouse keypress("q")" to wait for a specifik key?
Cheers,
Maximilian
|