gnuplot
from the UNIX prompt.
Gnuplot can be run interactively, or from script files. Script files are simply ascii files that have commands written out just as you would enter them interactively. You can run a script two ways:
load "scriptname"
from within gnuplot.
gnuplot scriptname
.
In this method, gnuplot will exit when your script is finished, so you may want
to include PAUSE -1 "Hit any key to continue"
as your last line.
Now for some examples. Note that lines begining with #
are
comments.
d1.dat
.
#set terminal postfile (These commented lines would be used to ) #set output "d1_plot.ps" (generate a postscript file. ) set title "Energy vs. Time for Sample Data" set xlabel "Time" set ylabel "Energy" plot "d1.dat" with lines pause -1 "Hit any key to continue" |
This example uses the default X11 window for output. It sets the name of the plot title. Then it set the names of the x-axis and y-axis to Time and Energy (default would be X and Y). The plot command is really the key line. It plots data from a file, using column 1 and 2 as the default x and y values. The limits are set automatically, and data points are connected with lines. Some variations on the plot command are:
plot sin(x) with lines
plot [0,10] [0.2,0.6] "d1.dat" with lines
plot "d1.dat" with points
plot "d1.dat" with linespoints
plot "data.dat" using 4:2 with lines
plot "d1.dat" with lines, exp(x) with lines
plot "d1.dat" title 'Sample Data' with lines
or, if you don't like the key, try plot "d1.dat" notitle with lines
help plot
from more information.