Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

exit from the reread loop

871 views
Skip to first unread message

Michael Okuntsov

unread,
Mar 13, 2014, 3:40:26 PM3/13/14
to
Hello,

the command reread is very useful, but if the gnuplot file is launched,
for example, through a desktop shortcut, then untrained user may not
understand how to completely close gnuplot window (ctrl+alt+del in
Windows, "killall gnuplot" in Linux). Is there a way to close gnuplot
window and exit from the endless loop?

Karl

unread,
Mar 14, 2014, 4:27:04 AM3/14/14
to
Not clear what you mean. Can you show a small example script?

you know

if (<rereadcondition>) reread

, i guess? Also "pause -1" gives the uses an opportunity to stop a script.

K

Michael

unread,
Mar 14, 2014, 5:07:31 AM3/14/14
to
14.03.2014 15:27, Karl пишет:

> Not clear what you mean. Can you show a small example script?
>
> you know
>
> if (<rereadcondition>) reread
>
> , i guess? Also "pause -1" gives the uses an opportunity to stop a script.
>
> K
>

We measure a long-term process. It's unknown when it will end. Here is a
script:

set term wxt enh font ",12"
set format y "%.2tE%+02T"
unset key
set grid xtics
set grid ytics

plot "/home/michael/tmp/data.dat" u 2:5 w lines lw 2
pause 5
reread

Karl

unread,
Mar 14, 2014, 5:54:03 AM3/14/14
to
You could check for differences between the last two plots. Say the x
axis in your plot gets ever longer:

====

if (!exists("nowmaxx")) nowmaxx = 0 # initialize the variable

lastmaxx = nowmaxx
nowmaxx = GPVAL_DATA_X_MAX

plot ...

if (lastmaxx <> nowmaxx) reread

====

there are other GPVAL_ status variables that are updated after every
plot. Or you could use "stats" on your datafile, and use one of the
stats status variables.

K

Michael

unread,
Mar 14, 2014, 6:06:19 AM3/14/14
to
14.03.2014 16:54, Karl пишет:

> You could check for differences between the last two plots. Say the x
> axis in your plot gets ever longer:
>
> ====
>
> if (!exists("nowmaxx")) nowmaxx = 0 # initialize the variable
>
> lastmaxx = nowmaxx
> nowmaxx = GPVAL_DATA_X_MAX
>
> plot ...
>
> if (lastmaxx <> nowmaxx) reread
>
> ====
>
> there are other GPVAL_ status variables that are updated after every
> plot. Or you could use "stats" on your datafile, and use one of the
> stats status variables.
>
> K
>

Oh, thanks! I just wasn't sure what condition should I use for exiting.

Karl

unread,
Mar 19, 2014, 11:03:28 AM3/19/14
to
Am 14.03.2014 11:06, schrieb Michael:
> 14.03.2014 16:54, Karl пишет:
>

Does anyone else see five cyrillic letters (transliterating to "wrote")
after my name above?

WTF?

;-)

Karl

unread,
Mar 19, 2014, 11:06:46 AM3/19/14
to
i get it. Michael has a .ru email address.

;-)

Michael Okuntsov

unread,
Mar 19, 2014, 12:50:44 PM3/19/14
to
19.03.2014 22:06, Karl пишет:
Schreiben, schrieb, geschrieben ;)

dariom...@gmail.com

unread,
Mar 29, 2017, 5:03:22 AM3/29/17
to
It's quite a late reply, but I hope could be useful for other users.
Usually I escape from 'reread' loop using a variable and a binding.

bind "Close" "reread_loop = 0"
reread_loop = 1
if(reread_loop==1) reread

I'm using gnuplot5.0.
That's my 2 cents.

Dario
0 new messages