Alexiades - UTK
Gnuplot on the fly
The easiest way to use Gnuplot on Unix is via scripts.
Put these files in the directory with your code
(better: in a dir on your unix PATH, mine is ~/.S/ ):
gplot
gpgp
gnuplot.sh,
gnuplot_template
The shell script gplot produces a gnuplot-script
out of the datafile (and calls gpgp).
The shell script gpgp
creates the plot (as .ps or .png) and displays the plot.
They must be executable:
chmod +x gplot gpgp
Here is how to use them:
- To plot a (multicolumn) file, say "dat", at the unix prompt type:
gplot dat
(it prompts you for columns, defaults: 1 , 2).
This creates a gnuplot-script file dat.gp .
- You can edit the dat.gp file to customize it for this plot
(set title, xrange, yrange, other files to plot, etc).
- Then do: gpgp dat.gp
which gnuplots it producing "dat.ps", and displays the plot with gv.