Go to the first, previous, next, last section, table of contents.

Syntax

The general rules of syntax and punctuation in gnuplot are that keywords and options are order-dependent. Options and any accompanying parameters are separated by spaces whereas lists and coordinates are separated by commas. Ranges are separated by colons and enclosed in brackets [], text and file names are enclosed in quotes, and a few miscellaneous things are enclosed in parentheses. Braces {} are used for a few special purposes.

Commas are used to separate coordinates on the set commands arrow, key, and label; the list of variables being fitted (the list after the via keyword on the fit command); lists of discrete contours or the loop parameters which specify them on the set cntrparam command; the arguments of the set commands dgrid3d, dummy, isosamples, offsets, origin, samples, size, time, and view; lists of tics or the loop parameters which specify them; the offsets for titles and axis labels; parametric functions to be used to calculate the x, y, and z coordinates on the plot, replot and splot commands; and the complete sets of keywords specifying individual plots (data sets or functions) on the plot, replot and splot commands.

Parentheses are used to delimit sets of explicit tics (as opposed to loop parameters) and to indicate computations in the using filter of the fit, plot, replot and splot commands.

(Parentheses and commas are also used as usual in function notation.)

Brackets are used to delimit ranges, whether they are given on set, plot or splot commands.

Colons are used to separate extrema in range specifications (whether they are given on set, plot or splot commands) and to separate entries in the using filter of the plot, replot, splot and fit commands.

Semicolons are used to separate commands given on a single command line.

Braces are used in text to be specially processed by some terminals, like postscript. They are also used to denote complex numbers: {3,2} = 3 + 2i.

Text may be enclosed in single- or double-quotes. Backslash processing of sequences like \n (newline) and \345 (octal character code) is performed for double-quoted strings, but not for single-quoted strings.

The justification is the same for each line of a multi-line string. Thus the center-justified string

     "This is the first line of text.\nThis is the second line."

will produce

                      This is the first line of text.
                         This is the second line.

but

     'This is the first line of text.\nThis is the second line.'

will produce

         This is the first line of text.\nThis is the second line.

Filenames may be entered with either single- or double-quotes. In this manual the command examples generally single-quote filenames and double-quote other string tokens for clarity.

At present you should not embed \n inside {} when using the enhanced option of the postscript terminal.

The EEPIC, Imagen, Uniplex, LaTeX, and TPIC drivers allow a newline to be specified by \\ in a single-quoted string or \\\\ in a double-quoted string.

Back-quotes are used to enclose system commands for substitution.


Go to the first, previous, next, last section, table of contents.