0
votes

I am trying to launch gnuplot and plot the graph for me with a single command. My script looks like this:

gnuplot

load "runscript"

But it would ignore the second command. Any help would be appreciated,Thanks.

1
which operating system? Are you typing load 'runscript' in the gnuplot console? - theozh
I am running ubuntu & using terminal to run the script. "runscript" is the name of my other script file. - machinecat
what is the code, i.e. what is the content of 'runscript'? - theozh
set xdata time && set timefmt "%b %d %Y %H:%M:%S" && plot "M_data_test" using 1:5 with lines - machinecat
what is &&? why don't you save your script into a text file, one line per command and load it from the gnuplot command line? - theozh

1 Answers

0
votes

I think that is no necessary to create another script to launch Gnuplot and then load your plotting script. This task is easy to be done using the Gnuplot commands. For example, consider you have a script called "test.gp" and its contents are:

set xlabel "Time t"
set ylabel "sin(t)"
set title 'Gnuplot test with PDFcairo'
plot [0:2*pi] sin(x) with lines lw 2 title 'Sin(x)'

Then, to run your "tes.gp" script just go to the folder that contains the file, and type in the command line:

gnuplot -p test.gp

the '-p' option allows the persist mode and remains the plot window.