plplot is a very powerful library, and has many options for
specifying how the plots turn out. However, in most of the plots you
will do, you will simply be looking for the information contained
within the plot, and the defaults will be quite acceptable.
The advanced options will be covered in the next section.
The basic command to get information from to gnuplot is the
plot
command. See Section
for detailed reference
information. plot
normally takes either a single matrix, a
list of matricies, or a string as its argument. If you wish to, you
may also add a second argument, which is the plot process number (see
above).
If the argument is a string, the string (without the surrounding
double quotes) is passed directly to gnuplot. This was used above,
and will be used again when we see the advanced plotting features.
If the argument is a single matrix, then first column is taken as the
independant variable, and the second and higher columns are plotted
against it.
If the matrix only has one column, then the index values are used as
the independant variable, and the column vector is plotted as the
dependent variable.
The third type of input is using a list of matricies. This is a very
flexible tool, though it has little point unless the matricies have
different first columns. In this case, the two matricies will
be plotted on the same graph, over the domains specified by the first
column.
If you want to have two different plots at the same time, you need to
specify a plot process number. Here is an example of how to produce
three graphs on a system capable of displaying several windows, such
as X windows:
The last command shows how to plot multiple curves on a single plot
without using a list — remember that each column after the first is
treated as a dependant variable to the first column.
The effect of this is best seen by actually trying it on a system
capable of displaying multiple plots.
After you have produced multiple plots, you may wish to clean up the screen
and free up some resources, so you need to kill some of the plots.
You could always exit , but that is not always desirable. So
the pclose
function is provided. Section
has
all the details, so suffice to say that you can kill off a plot process
by specifying its plot process number as an argument to pclose
.
With all those plot process numbers floating around, it is easy to
lose track of how each one is set up, and which files it is using (or
would use).