|
From: Mojca M. <moj...@gm...> - 2006-04-17 21:05:48
|
I'm sorry for a stupid question (probably not the most appropriate for
this list, but I didn't find the answer yet): how can I ignore
"pause"? I would like to call gnuplot from an external program (with
"set terminal whatever", has to produce a couple of graphics and then
exit quitely) and "I can't afford to hire a robot" to keep pushing
"enter" on pauses triggered with "pause -1"? Pause is good for
interactive terminals, but not when writing images into a file.
I would appreciate any hints,
Mojca
|
|
From: Ethan M. <merritt@u.washington.edu> - 2006-04-17 21:54:10
|
On Monday 17 April 2006 02:05 pm, Mojca Miklavec wrote: > I'm sorry for a stupid question (probably not the most appropriate for > this list, but I didn't find the answer yet): how can I ignore > "pause"? I would like to call gnuplot from an external program (with > "set terminal whatever", has to produce a couple of graphics and then > exit quitely) and "I can't afford to hire a robot" to keep pushing > "enter" on pauses triggered with "pause -1"? Pause is good for > interactive terminals, but not when writing images into a file. This is a strange question, because "pause -1" should return immediately if the input is from a script. How, exactly, are you feeding your commands to gnuplot? And if you are piping the commands from an external program, why is it listening to the keyboard even if you *were* to hire a robot key-presser? Off-the-wall suggestions, since I don't really understand how your problem is created. 1) Don't put any pause statements in your automated scripts to begin with 2) sed -e 's/pause -1//' < script | gnuplot 3) gnuplot script < /bin/true -- Ethan A Merritt Biomolecular Structure Center University of Washington, Seattle WA |
|
From: Mojca M. <moj...@gm...> - 2006-04-17 22:26:22
|
On 4/17/06, Ethan Merritt wrote:
> On Monday 17 April 2006 02:05 pm, Mojca Miklavec wrote:
> > I'm sorry for a stupid question (probably not the most appropriate for
> > this list, but I didn't find the answer yet): how can I ignore
> > "pause"? I would like to call gnuplot from an external program (with
> > "set terminal whatever", has to produce a couple of graphics and then
> > exit quitely) and "I can't afford to hire a robot" to keep pushing
> > "enter" on pauses triggered with "pause -1"? Pause is good for
> > interactive terminals, but not when writing images into a file.
>
> This is a strange question, because "pause -1" should return
> immediately if the input is from a script.
> How, exactly, are you feeding your commands to gnuplot?
I have a gnuplot.bat with
c:\path-to-wgnuplot.exe %*
and I call it with
gnuplot somescript.plt
where somescript.plt might be something like
set terminal context
set output "somefile.tex"
plot sin(x)
pause -1
plot cos(x)
or perhaps
load "somefile.dem" # any demo file from the distribution
Then a pause windows pops up and wants me to press Enter in order to procee=
d.
I'm still using the "old" windows terminal. Perhaps wxwidgets behave better=
.
> And if you are piping the commands from an external program,
> why is it listening to the keyboard even if you *were* to
> hire a robot key-presser?
I'm not piping (I guess). I'm only calling "gnuplot[.bat]
somescript.plt" from TeX.
> Off-the-wall suggestions, since I don't really understand how
> your problem is created.
>
> 1) Don't put any pause statements in your automated scripts to begin with
Sure, but if I want to test demo scripts out of the box ... I won't
write any pause statements in my scripts (although I still might want
to use the same code for testing the plots where I need pauses and for
producing high quality plots where I would want them to be ignored).
> 2) sed -e 's/pause -1//' < script | gnuplot
>
> 3) gnuplot script < /bin/true
But that can't be used under windows (where I'm experiencing the "problem")=
.
I don't have access to any linux box at the moment, but well ... I can
try what happens there.
GhostScript has -dBATCH -dNOPAUSE switches for the same purpose for example=
.
Thanks,
Mojca
|
|
From: Daniel J S. <dan...@ie...> - 2006-04-17 22:36:43
|
Ethan Merritt wrote: > Off-the-wall suggestions, since I don't really understand how > your problem is created. > > 1) Don't put any pause statements in your automated scripts to begin with > > 2) sed -e 's/pause -1//' < script | gnuplot > > 3) gnuplot script < /bin/true Hans said the other day to try something like gnuplot all.dem < /dev/null Could try that. Dan |
|
From:
<br...@ph...> - 2006-04-18 18:12:58
|
Mojca Miklavec wrote: > I have a gnuplot.bat with > c:\path-to-wgnuplot.exe %* Calling that batch file gnuplot.bat instead of wgnuplot.bat is creating smoke screen that hides the crucial detail: that you're doing this on MS Windows. That's one single gnuplot platform where pause -1 can't detect that stdin was redirected (because Win32 GUI apps like wgnuplot don't *have* a stdin, so nothing to redirect), and therefore the usual method of short-circuiting pause -1 doesn't work. > I'm still using the "old" windows terminal. Perhaps wxwidgets behave better. IIRC it doesn't. Wxwidgets only replaces the graph window, but not the text console window, nor the pause window. > I'm not piping (I guess). Correctly. To pipe, you would have to use pgnuplot, not wgnuplot. |
|
From: Mojca M. <moj...@gm...> - 2006-04-20 11:32:50
|
On 4/18/06, Hans-Bernhard Br=F6ker wrote:
> Mojca Miklavec wrote:
> > I have a gnuplot.bat with
> > c:\path-to-wgnuplot.exe %*
>
> Calling that batch file gnuplot.bat instead of wgnuplot.bat is creating
> smoke screen that hides the crucial detail: that you're doing this on MS
> Windows.
I'm sorry that I forgot to mention that. I wasn't aware that gnuplot
in windows behaves differently from the rest of the terminals in this
respect.
> That's one single gnuplot platform where pause -1 can't detect
> that stdin was redirected (because Win32 GUI apps like wgnuplot don't
> *have* a stdin, so nothing to redirect), and therefore the usual method
> of short-circuiting pause -1 doesn't work.
So is there any remedy for that? Could I set any variable which will
explicitely tell gnuplot to ignore pauses?
> > I'm still using the "old" windows terminal. Perhaps wxwidgets behave be=
tter.
>
> IIRC it doesn't. Wxwidgets only replaces the graph window, but not the
> text console window, nor the pause window.
>
> > I'm not piping (I guess).
>
> Correctly. To pipe, you would have to use pgnuplot, not wgnuplot.
How can I compile gnuplot so that I would get pgnuplot instead of
wgnuplot? What's the main difference between the two variants?
Thanks a lot,
Mojca
|
|
From:
<br...@ph...> - 2006-04-20 11:13:49
|
Mojca Miklavec wrote: > On 4/18/06, Hans-Bernhard Bröker wrote: >> Mojca Miklavec wrote: >>> I have a gnuplot.bat with >>> c:\path-to-wgnuplot.exe %* >> Calling that batch file gnuplot.bat instead of wgnuplot.bat is creating >> smoke screen that hides the crucial detail: that you're doing this on MS >> Windows. > > I'm sorry that I forgot to mention that. I wasn't aware that gnuplot > in windows behaves differently from the rest of the terminals in this > respect. It's not the terminal that behaves differently --- it's the console that handles text I/O for the gnuplot command line. Windows originally didn't have the notion of a console program at all, back when gnuplot was ported to this platform (16-bit Windows 3.x). So the people back then had to create their own poor-man's equivalent of xterm: the wgnuplot text window. This is a graphical window handling non-graphical text input and output. But it has no connection to the concept of a stdin or stdout channel. I've been working on and off on a re-write of this part of the Windows port, to use a genuine Win32 console instead of our home-grown one. If that ever bears fruit, it'll solve this problem. Until then, you can't wgnuplot to pipe in or out. > So is there any remedy for that? Could I set any variable which will > explicitely tell gnuplot to ignore pauses? No. > How can I compile gnuplot so that I would get pgnuplot instead of > wgnuplot? You can't. pgnuplot is not a variant of wgnuplot, it's built as a separate, small program that communicates with wgnuplot. If you want a fully console-compatible gnuplot on Win32, you have to get the Cygwin binary. The delivered package of that uses and requires X11, but you can also build a console-only one by disabling X11. |
|
From: Mojca M. <moj...@gm...> - 2006-04-20 11:26:22
|
On 4/20/06, Hans-Bernhard Br=F6ker wrote: > Mojca Miklavec wrote: > > On 4/18/06, Hans-Bernhard Br=F6ker wrote: > >> Mojca Miklavec wrote: > >>> I have a gnuplot.bat with > >>> c:\path-to-wgnuplot.exe %* > >> Calling that batch file gnuplot.bat instead of wgnuplot.bat is creatin= g > >> smoke screen that hides the crucial detail: that you're doing this on = MS > >> Windows. > > > > I'm sorry that I forgot to mention that. I wasn't aware that gnuplot > > in windows behaves differently from the rest of the terminals in this > > respect. > > It's not the terminal that behaves differently --- it's the console that > handles text I/O for the gnuplot command line. Windows originally > didn't have the notion of a console program at all, back when gnuplot > was ported to this platform (16-bit Windows 3.x). So the people back > then had to create their own poor-man's equivalent of xterm: the > wgnuplot text window. This is a graphical window handling non-graphical > text input and output. But it has no connection to the concept of a > stdin or stdout channel. > > I've been working on and off on a re-write of this part of the Windows > port, to use a genuine Win32 console instead of our home-grown one. If > that ever bears fruit, it'll solve this problem. Until then, you can't > wgnuplot to pipe in or out. > > > So is there any remedy for that? Could I set any variable which will > > explicitely tell gnuplot to ignore pauses? > > No. > > > How can I compile gnuplot so that I would get pgnuplot instead of > > wgnuplot? > > You can't. pgnuplot is not a variant of wgnuplot, it's built as a > separate, small program that communicates with wgnuplot. > > If you want a fully console-compatible gnuplot on Win32, you have to get > the Cygwin binary. The delivered package of that uses and requires X11, > but you can also build a console-only one by disabling X11. OK, thanks for the explanations. I'll compile the demo files on a linux box then, write a note to the users of the module about that and wait for the next & better version of the windows terminal for gnuplot ;) Mojca |