Part II : Tools of trade: a short tutorial introduction
Module 2 : gnuplot - the plotting freeware
 

1.4.2 Plotting sin(x) using a script file

If we write all the gnuplot commands in a file (say, filename.plt), we can use the command load "filename.plt" at the gnuplot command prompt and obtain the same effect.

Here is the file for plotting sin(x); note that gnuplot identifies comments by the use of the # symbol. In data files too, we can use # to write information about data for a human reader; gnuplot would disregard these lines while plotting.


# This is a comment! Plotting sin(x) with gnuplot
plot sin(x)