gnuplot Gnuplot is an interactive plotting program. It is easy to use to display data from files or to plot functions. Gnuplot will run under either Sunview or X Windows, or on a personal computer if it has a TEK terminal emulator. The CEC has recently upgraded to version 3.0 of gnuplot (from version 2.0). This new version provides added flexibility, including 3 dimensional plotting.
Type gnuplot, and you should see the following on your screen (under X Windows):
G N U P L O T
unix version 3.0
patchlevel 1, Dec 1 91
last modified Sun Dec 1 16:56:36 1991
Copyright (C) 1986, 1987, 1990, 1991 Colin Kelley, Thomas Williams
Send bugs and comments to root@cec.mtu.edu
Terminal type set to 'x11'
gnuplot>
At the gnuplot prompt, you can enter gnuplot commands. Examples of the most popular commands are listed below.
Gnuplot 3.0 allows you to choose which columns of a data file to use for plotting. This is done with the ``using'' option. For example, if you would like to plot columns 3 and 7 of an 8 column data file, the gnuplot command would be plot ``file1'' using 3:7. If you want column 3 to be the ``y'' value and column 7 to be the ``x'', you the proper command is plot ``file1'' using 7:3.
To save your gnuplot configuration to a file, type save ``filename'', where filename is the name of the file that you would like it saved to.
Gnuplot 3.0 allows 3-D plots to be created. This is done using splot instead of plot.
The general form of plot is as follows:
plot {ranges} <function> {title} {style} {, <function> {title} {style} ...}
The options for plot and splot are described in the gnuplot documentation, which is available in the CEC.
To leave gnuplot, type quit.
The set command has many options, several of which are described below. Corresponding show commands exist for most options.
To print a file generated using gnuplot, type gnuprint filename from the UNIX prompt, where filename is the name of the file in which you saved the gnuplot commands from within gnuplot.