UNIX-GNUPlot
Description
Gnuplot is a command-driven interactive function and data plotting program. The plots are x-y data plots with functions in 2D or x-y-z data plots with surfaces in 3D. The plots can be displayed on the screen for interactive graphical exploration or stored in a file using many common graphical formats. This way the constructed graph can viewed, printed, or saved to be included in a document or web page.
The official web page for gnuplot is www.gnuplot.info.
Where to find gnuplot
-
Where Can I Use gnuplot on
Campus?
Gnuplot version 3.7 is available on Strauss and Mahler in the standard path using the command gnuplot.
-
How Can I Obtain gnuplot for my
Personal Computer?
The current version of gnuplot is 4.4.0, and it is a sourceforge project - see sourceforge.net/projects/gnuplot to download gnuplot.
Gnuplot instructions
-
Running gnuplot Interactively on
Strauss or Mahler.
At the UNIX prompt (%) type
gnuplotThe following will appear to begin your command line session:
G N U P L O T Unix version 3.7 patchlevel 1 last modified Fri Oct 22 18:00:00 BST 1999 Copyright(C) 1986 - 1993, 1998, 1999 Thomas Williams, Colin Kelley and many others Type `help` to access the on-line reference manual The gnuplot FAQ is available from http://www.ucc.ie/gnuplot/gnuplot-faq.html Send comments and requests for help to info-gnuplot@dartmouth.edu Send bugs, suggestions and mods to bug-gnuplot@dartmouth.edu
If your see the Terminal type set to 'x11' then you are on an X windows device and you can see the the output for any plot command in a new window. For example the
plot sin(x)
command will produce a window with the the plot:
To exit your gnuplot session type:
quit
-
Making a plot to be displayed on a
web page
To make a copy of your plot for a web page, change the output format to "png," set the name of the output file and type the plot command again (or simply replot to save the current picture).
set terminal png
set output 'fig.png'
plot sin(x)Then the sin(x) plot in the fig.png file can be display using the Firefox browser as shown below:
-
Printing from Gnuplot
To print your plot, change the output format to "postscript," set the name of the output file to the print command and type the plot command again (or simply replot to print the current picture).
set terminal postscript
set output '|lpr'
plot sin(x)- Make sure you begin the command with the pipe symbol: |. If you do not, Gnuplot will save your postscript output in a file.
- The lpr command will
print to the printer you specified
in your PRINTER
environment variable or
smips
if you did not specify a
printer.
-
on-line help
The Gnuplot online help is all text-based. To see the online help, type the gnuplot command help. Make sure you watch the prompt. When you get back to the gnuplot> prompt, you can continue and type more gnuplot commands.
