Is there a way to specify data file in batch mode?

Is there a way to specify data file in batch mode?

Post by Sean » Fri, 20 Oct 2006 07:26:42


If I wan to have the following effect, how can I read parameter field
in gnuplot script? Thanks


$gnuplot myscrip.plt <the data file I want to plot>




-------------------
####################
#How can I set input as parameter?
####################
plot using 1:2 title "" with points
--------------------
 
 
 

Is there a way to specify data file in batch mode?

Post by merrit » Fri, 20 Oct 2006 08:03:33

In article < XXXX@XXXXX.COM >,


The traditional way is to run gnuplot via piped commands from a
script, and have the script substitute in the appropriate file name
when it stuffs the plot command in the end of the pipe.

Here's another way, introduced in version 4.1

[1] setenv FILE "myfilename.dat"
[2] gnuplot myscript.plt

where myscript.plt contains:
...
filename = system("getenv FILE")
plot filename using 1:2 with points title filename
...



That's a csh/tcsh version, but it's easily adapted to a shell
of your choice.
--
Ethan A Merritt