|
From: Philipp K. J. <ja...@ie...> - 2015-02-09 03:37:24
|
It used to be possible to pipe commands to gnuplot: cat script.gp | gnuplot When I try this with gp5, gnuplot seems to ignore the input. I did not see any comment on this in the documentation either way. What behavior should I expect? Best, Ph. |
|
From: Jonathan T. <jt...@as...> - 2015-02-09 06:00:14
|
Hi,
On Sun, Feb 08, 2015 at 07:37:15PM -0800, Philipp K. Janert wrote:
> It used to be possible to pipe commands to gnuplot:
>
> cat script.gp | gnuplot
>
> When I try this with gp5, gnuplot seems to ignore
> the input.
>
> I did not see any comment on this in the documentation
> either way. What behavior should I expect?
Piping commands to gnuplot works fine for me with gnuplot 5.0.0
running on OpenBSD 5.6. In fact, I often do this for visualization:
I've written a Tk/Perl program 'slider' which provides a GUI to walk
through a data set, and outputs gnuplot commands for visualization;
I use it via shell scripts like this one:
#!/bin/sh
slider --min 401.022164175591 \
--delta 1.00255541043898 \
--max 501.277705219488 \
--continuous \
--command-file ../Phi.rl1-4.3D-slider-gnuplot-template \
| gnuplot
For a standalone test:
% uname -a
OpenBSD copper.astro.indiana.edu 5.6 GENERIC.MP#0 amd64
% echo 'show version long' | gnuplot
G N U P L O T
Version 5.0 patchlevel 0 last modified 2015-01-01
Copyright (C) 1986-1993, 1998, 2004, 2007-2015
Thomas Williams, Colin Kelley and many others
gnuplot home: http://www.gnuplot.info
faq, bugs, etc: type "help FAQ"
immediate help: type "help" (plot window: hit 'h')
Compile options:
-READLINE +LIBREADLINE -HISTORY
-BACKWARDS_COMPATIBILITY +BINARY_DATA
+GD_PNG +GD_JPEG +GD_TTF +GD_GIF +ANIMATION
-USE_CWDRC +X11 +X11_POLYGON +MULTIBYTE +X11_EXTERNAL +USE_MOUSE +HIDDEN3D_QUADTREE
+DATASTRINGS +HISTOGRAMS +OBJECTS +STRINGVARS +MACROS +THIN_SPLINES +IMAGE +USER_LINETYPES +STATS +EXTERNAL_FUNCTIONS
GNUPLOT_DRIVER_DIR = "/usr/local/libexec/gnuplot/5.0"
GNUPLOT_PS_DIR = "/usr/local/share/gnuplot/5.0/PostScript"
HELPFILE = "/usr/local/share/gnuplot/5.0/gnuplot.gih"
% echo 'set term x11 persist; plot sin(x)' | gnuplot
%
That last command produced an X window with the plot.
What gnuplot version are you using, and on what system?
ciao,
--
-- "Jonathan Thornburg [remove -animal to reply]" <jt...@as...>
Dept of Astronomy & IUCSS, Indiana University, Bloomington, Indiana, USA
"There was of course no way of knowing whether you were being watched
at any given moment. How often, or on what system, the Thought Police
plugged in on any individual wire was guesswork. It was even conceivable
that they watched everybody all the time." -- George Orwell, "1984"
|
|
From: Philipp K. J. <ja...@ie...> - 2015-02-09 06:07:50
|
No, it doesn't work for me.
Here is the contents of my test script:
set t pngcairo
plot sin(x)
I invoke it like this:
cat script.gp | gnuplot > graph.png
When I use gnuplot 4.6 patchlevel 3 (which comes
with my distro), all is well. But when I use version
5, nothing happens - I simply get dropped into an
interactive session.
Mind you, batch processing works with version 5:
gnuplot5 script.gp > graph.png
is fine.
Here are the specifics:
Linux puget 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC
2013 x86_64 x86_64 x86_64 GNU/Linux
G N U P L O T
Version 5.0 patchlevel 0 last modified 2015-01-01
Copyright (C) 1986-1993, 1998, 2004, 2007-2015
Thomas Williams, Colin Kelley and many others
gnuplot home: http://www.gnuplot.info
faq, bugs, etc: type "help FAQ"
immediate help: type "help" (plot window: hit 'h')
On Mon, 9 Feb 2015 00:26:20 -0500
Jonathan Thornburg <jt...@as...> wrote:
> Hi,
>
> On Sun, Feb 08, 2015 at 07:37:15PM -0800, Philipp K. Janert wrote:
> > It used to be possible to pipe commands to gnuplot:
> >
> > cat script.gp | gnuplot
> >
> > When I try this with gp5, gnuplot seems to ignore
> > the input.
> >
> > I did not see any comment on this in the documentation
> > either way. What behavior should I expect?
>
> Piping commands to gnuplot works fine for me with gnuplot 5.0.0
> running on OpenBSD 5.6. In fact, I often do this for visualization:
> I've written a Tk/Perl program 'slider' which provides a GUI to walk
> through a data set, and outputs gnuplot commands for visualization;
> I use it via shell scripts like this one:
>
> #!/bin/sh
> slider --min 401.022164175591 \
> --delta 1.00255541043898 \
> --max 501.277705219488 \
> --continuous \
> --command-file ../Phi.rl1-4.3D-slider-gnuplot-template \
> | gnuplot
>
> For a standalone test:
>
> % uname -a
> OpenBSD copper.astro.indiana.edu 5.6 GENERIC.MP#0 amd64
> % echo 'show version long' | gnuplot
>
> G N U P L O T
> Version 5.0 patchlevel 0 last modified 2015-01-01
>
> Copyright (C) 1986-1993, 1998, 2004, 2007-2015
> Thomas Williams, Colin Kelley and many others
>
> gnuplot home: http://www.gnuplot.info
> faq, bugs, etc: type "help FAQ"
> immediate help: type "help" (plot window: hit 'h')
> Compile options:
> -READLINE +LIBREADLINE -HISTORY
> -BACKWARDS_COMPATIBILITY +BINARY_DATA
> +GD_PNG +GD_JPEG +GD_TTF +GD_GIF +ANIMATION
> -USE_CWDRC +X11 +X11_POLYGON +MULTIBYTE +X11_EXTERNAL +USE_MOUSE
> +HIDDEN3D_QUADTREE +DATASTRINGS +HISTOGRAMS +OBJECTS +STRINGVARS
> +MACROS +THIN_SPLINES +IMAGE +USER_LINETYPES +STATS
> +EXTERNAL_FUNCTIONS
>
> GNUPLOT_DRIVER_DIR = "/usr/local/libexec/gnuplot/5.0"
> GNUPLOT_PS_DIR = "/usr/local/share/gnuplot/5.0/PostScript"
> HELPFILE = "/usr/local/share/gnuplot/5.0/gnuplot.gih"
>
> % echo 'set term x11 persist; plot sin(x)' | gnuplot
> %
>
> That last command produced an X window with the plot.
>
>
> What gnuplot version are you using, and on what system?
>
> ciao,
>
|
|
From: sfeam <sf...@us...> - 2015-02-09 06:28:09
|
On Sunday, 08 February 2015 10:07:42 PM Philipp K. Janert wrote: > > No, it doesn't work for me. > > Here is the contents of my test script: > > set t pngcairo > plot sin(x) > > I invoke it like this: > > cat script.gp | gnuplot > graph.png Works fine here using the v5 release and also current CVS. Ethan > > When I use gnuplot 4.6 patchlevel 3 (which comes > with my distro), all is well. But when I use version > 5, nothing happens - I simply get dropped into an > interactive session. > > Mind you, batch processing works with version 5: > > gnuplot5 script.gp > graph.png > > is fine. > > > Here are the specifics: > > Linux puget 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC > 2013 x86_64 x86_64 x86_64 GNU/Linux > > > G N U P L O T > Version 5.0 patchlevel 0 last modified 2015-01-01 > > Copyright (C) 1986-1993, 1998, 2004, 2007-2015 > Thomas Williams, Colin Kelley and many others > > gnuplot home: http://www.gnuplot.info > faq, bugs, etc: type "help FAQ" > immediate help: type "help" (plot window: hit 'h') > > > On Mon, 9 Feb 2015 00:26:20 -0500 > Jonathan Thornburg <jt...@as...> wrote: > > > Hi, > > > > On Sun, Feb 08, 2015 at 07:37:15PM -0800, Philipp K. Janert wrote: > > > It used to be possible to pipe commands to gnuplot: > > > > > > cat script.gp | gnuplot > > > > > > When I try this with gp5, gnuplot seems to ignore > > > the input. > > > > > > I did not see any comment on this in the documentation > > > either way. What behavior should I expect? > > > > Piping commands to gnuplot works fine for me with gnuplot 5.0.0 > > running on OpenBSD 5.6. In fact, I often do this for visualization: > > I've written a Tk/Perl program 'slider' which provides a GUI to walk > > through a data set, and outputs gnuplot commands for visualization; > > I use it via shell scripts like this one: > > > > #!/bin/sh > > slider --min 401.022164175591 \ > > --delta 1.00255541043898 \ > > --max 501.277705219488 \ > > --continuous \ > > --command-file ../Phi.rl1-4.3D-slider-gnuplot-template \ > > | gnuplot > > > > For a standalone test: > > > > % uname -a > > OpenBSD copper.astro.indiana.edu 5.6 GENERIC.MP#0 amd64 > > % echo 'show version long' | gnuplot > > > > G N U P L O T > > Version 5.0 patchlevel 0 last modified 2015-01-01 > > > > Copyright (C) 1986-1993, 1998, 2004, 2007-2015 > > Thomas Williams, Colin Kelley and many others > > > > gnuplot home: http://www.gnuplot.info > > faq, bugs, etc: type "help FAQ" > > immediate help: type "help" (plot window: hit 'h') > > Compile options: > > -READLINE +LIBREADLINE -HISTORY > > -BACKWARDS_COMPATIBILITY +BINARY_DATA > > +GD_PNG +GD_JPEG +GD_TTF +GD_GIF +ANIMATION > > -USE_CWDRC +X11 +X11_POLYGON +MULTIBYTE +X11_EXTERNAL +USE_MOUSE > > +HIDDEN3D_QUADTREE +DATASTRINGS +HISTOGRAMS +OBJECTS +STRINGVARS > > +MACROS +THIN_SPLINES +IMAGE +USER_LINETYPES +STATS > > +EXTERNAL_FUNCTIONS > > > > GNUPLOT_DRIVER_DIR = "/usr/local/libexec/gnuplot/5.0" > > GNUPLOT_PS_DIR = "/usr/local/share/gnuplot/5.0/PostScript" > > HELPFILE = "/usr/local/share/gnuplot/5.0/gnuplot.gih" > > > > % echo 'set term x11 persist; plot sin(x)' | gnuplot > > % > > > > That last command produced an X window with the plot. > > > > > > What gnuplot version are you using, and on what system? |
|
From: Daniel J S. <dan...@ie...> - 2015-02-09 06:50:38
|
On 02/09/2015 12:07 AM, Philipp K. Janert wrote: > > No, it doesn't work for me. > > Here is the contents of my test script: > > set t pngcairo > plot sin(x) > > I invoke it like this: > > cat script.gp | gnuplot> graph.png > > When I use gnuplot 4.6 patchlevel 3 (which comes > with my distro), all is well. But when I use version > 5, nothing happens - I simply get dropped into an > interactive session. > > Mind you, batch processing works with version 5: > > gnuplot5 script.gp> graph.png > > is fine. Version 5.1 patchlevel 0 works on your test script. What are you seeing when the shell goes into interactive session? If I run gnuplot > graph.png as if the two sides of the command were treated normally (i.e., not one piped into another), the interactive part doesn't work because the visual output is sent to graph.png. How about something in your autoload .gnuplot file that might be causing problems. (Although I can't imagine what that might be.) Dan |