Next: , Previous: Copyright, Up: gnuplot

1.2 Introduction

`Gnuplot` is a portable command-line driven graphing utility for Linux, OS/2, MS Windows, OSX, VMS, and many other platforms. The source code is copyrighted but freely distributed (i.e., you don't have to pay for it). It was originally created to allow scientists and students to visualize mathematical functions and data interactively, but has grown to support many non-interactive uses such as web scripting. It is also used as a plotting engine by third-party applications like Octave. Gnuplot has been supported and under active development since 1986.

Gnuplot supports many types of plots in either 2D and 3D. It can draw using lines, points, boxes, contours, vector fields, surfaces, and various associated text. It also supports various specialized plot types.

Gnuplot supports many different types of output: interactive screen terminals (with mouse and hotkey input), direct output to pen plotters or modern printers, and output to many file formats (eps, fig, jpeg, LaTeX, metafont, pbm, pdf, png, postscript, svg, ...). Gnuplot is easily extensible to include new output modes. Recent additions include interactive terminals based on aquaterm (OSX) and wxWidgets (multiple platforms).

The command language of `gnuplot` is case sensitive, i.e. commands and function names written in lowercase are not the same as those written in capitals. All command names may be abbreviated as long as the abbreviation is not ambiguous. Any number of commands may appear on a line, separated by semicolons (;). Strings may be set off by either single or double quotes, although there are some subtle differences. See `syntax` and `quotes` for more details. Examples:

           load "filename"
           cd 'dir'

Many `gnuplot` commands have multiple options. Version 4 is less sensitive to the order of these options than earlier versions, but some order-dependence remains. If you see error messages about unrecognized options, please try again using the exact order listed in the documentation.

Commands may extend over several input lines by ending each line but the last with a backslash (\). The backslash must be the _last_ character on each line. The effect is as if the backslash and newline were not there. That is, no white space is implied, nor is a comment terminated. Therefore, commenting out a continued line comments out the entire command (see `comments`). But note that if an error occurs somewhere on a multi-line command, the parser may not be able to locate precisely where the error is and in that case will not necessarily point to the correct line.

In this document, curly braces ({}) denote optional arguments and a vertical bar (|) separates mutually exclusive choices. `Gnuplot` keywords or help topics are indicated by backquotes or `boldface` (where available). Angle brackets (<>) are used to mark replaceable tokens. In many cases, a default value of the token will be taken for optional arguments if the token is omitted, but these cases are not always denoted with braces around the angle brackets.

For built-in help on any topic, type help followed by the name of the topic or `help ?` to get a menu of available topics.

The new `gnuplot` user should begin by reading about `plotting` (if in an interactive session, type `help plotting`).

See the simple.dem demo, also available together with other demos on the web page `Gnuplot` can be started from a command line or from an icon according to the desktop environment. Running it from command line can take the syntax

           gnuplot {OPTIONS} file1 file2 ...

where file1, file2, etc. are input file as in the `load` command. On X11-based systems, you can use

           gnuplot {X11OPTIONS} {OPTIONS} file1 file2 ...

see your X11 documentation or rather `x11` in this document.

Options interpreted by gnuplot may come anywhere on the line. Files are executed in the order specified, as are commands supplied by the -e option, for example

           gnuplot   -e "reset"

The special filename "-" is used to force reading from stdin. `Gnuplot` exits after the last file is processed. If no load files are named, `Gnuplot` takes interactive input from stdin. See help `batch/interactive` for more details. The options specific to gnuplot can be listed by typing

           gnuplot --help

See `command line options` for more details.

Hit 'h' for help about `hotkeys` and `mousing` features in interactive screen terminals (`pm`, `windows`, `wxt`, `x11`).

Section `seeking-assistance` will help you to find further information, help and FAQ.