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

Using gnuplot in non-interactive mode.

843 views
Skip to first unread message

Young C. Chang - FES ~

unread,
Feb 28, 1997, 3:00:00 AM2/28/97
to

Hi, there.

I'd like to know how I can use gnuplot non-interactively.
I know that gnuplot is an interactive plotting program.
Can I also use it non-interactively? (ie, use 'gnuplot' in the script)

I have one more question.
How do I get hard copy output from gnuplot?
Can I print my output to postscript file?
If I can, could you tell me how?

Thanks in advance.

Young C Chang
yoc...@eng.fm.intel.com

--
--------------------------------------------------------------------
Young C. Chang
yoc...@eng.fm.intel.com
Folsom Engineering Services (FES)
Intel Corporation, Folsom, CA

"All opinions stated here are mine, not those of Intel Corporation."
--------------------------------------------------------------------

crawford richard

unread,
Feb 28, 1997, 3:00:00 AM2/28/97
to

In mMessage-Id: <97022809...@fsc015.fm.intel.com>

Young C. Chang <yoc...@pcocd2.intel.com> wrote:

> I'd like to know how I can use gnuplot non-interactively.
> I know that gnuplot is an interactive plotting program.
> Can I also use it non-interactively? (ie, use 'gnuplot' in the script)

Write your gnuplot commands into a file, and then use its name as an
argument when you invoke gnuplot. For example,

gnuplot command.file

will tell gnuplot to execute the commands in 'command.file'. But beware
that if you are having it write to a window, the window may close before
the plot is drawn. This can be prevented by putting "pause -1" after
each plotting command ("plot", "splot", and "replot"). [In pre-3.6, some
terminals also have the "-persist" option, which leaves the plot window
open when gnuplot itself closes.]


> I have one more question.
> How do I get hard copy output from gnuplot?
> Can I print my output to postscript file?
> If I can, could you tell me how?

There are two commands that govern output. The first, "set terminal",
tells gnuplot what kind of output to generate (PostScript commands,
Windows commands, commands specific to your printer, etc). The second,
"set output", tells gnuplot where to send the commands (to your printer,
your monitor, or a file). Obviously you need to choose a compatible
pair -- you can send Windows commands to a file, but why would you wan
to? Thus, for example,

set terminal postscript
set output "plot.ps"

will generate PostScript commands for all subsequent plots and store them
in the file 'plot.ps'.

gnuplot's "postscript" terminal has several options, which you can read
about in the manual or by typing "help terminal postscript".

"set terminal" without any further arguments will write a list of terminals
available to you on your monitor.


Dick Crawford, aka rccra...@lanl.gov

François Bujold

unread,
Mar 18, 1997, 3:00:00 AM3/18/97
to crawford richard

crawford richard wrote:
>
> In mMessage-Id: <97022809...@fsc015.fm.intel.com>
> Young C. Chang <yoc...@pcocd2.intel.com> wrote:
>
> > I'd like to know how I can use gnuplot non-interactively.
> > I know that gnuplot is an interactive plotting program.
> > Can I also use it non-interactively? (ie, use 'gnuplot' in the script)
>
My problem is reversed...
I am using the windows version 3.5. I can use it non-interactively but
when i try to use it interactively, the window pops open and shuts down
immediately.

Any one seen this problem before?

Karim Zamani

unread,
Mar 19, 1997, 3:00:00 AM3/19/97
to

François Bujold wrote:
>
> crawford richard wrote:
> >
> > In mMessage-Id: <97022809...@fsc015.fm.intel.com>
> > Young C. Chang <yoc...@pcocd2.intel.com> wrote:
> >
> > > I'd like to know how I can use gnuplot non-interactively.
> > > I know that gnuplot is an interactive plotting program.
> > > Can I also use it non-interactively? (ie, use 'gnuplot' in the script)

You use gnuplot on a script file that you creat with in the commands you
usually use in the interactive mode. And then just run : gnuplot
script_file.

> My problem is reversed...
> I am using the windows version 3.5. I can use it non-interactively but
> when i try to use it interactively, the window pops open and shuts down
> immediately.
>
> Any one seen this problem before?

add "pause -1;" in your script.

Karim.
---------------------
Contact Information :
www.antd.nist.gov/snad-staff/zamani

GWH

unread,
Mar 23, 1997, 3:00:00 AM3/23/97
to

François Bujold <fbu...@autoroute.net> wrote in article
<332EA6...@autoroute.net>...

> My problem is reversed...
> I am using the windows version 3.5. I can use it non-interactively but
> when i try to use it interactively, the window pops open and shuts down
> immediately.
>
> Any one seen this problem before?
>
I've got a similar problem. Running the windows version 3.5 on Win95, when
I try to plot, I get a GPF. I had it working for awhile after reinstalling
GnuPlot, but I had to reinstall Win95 and haven't been able to work GnuPlot
since, even after reinstalling. Anyone have any ideas or fixes?

Grant.

0 new messages