Gnuplot
*******

   GNUPLOT is a command-driven interactive function plotting program.

   For help on any topic, type `help' followed by the name of the topic.

   The new GNUPLOT user should begin by reading the `introduction' topic (type
`help introduction') and about the `plot' command (type `help plot').
Additional help can be obtained from the USENET newsgroup comp.graphics.gnuplot.

copyright
*********

         Copyright (C) 1986 - 1993   Thomas Williams, Colin Kelley

      Permission to use, copy, and distribute this software and its
      documentation for any purpose with or without fee is hereby granted,
      provided that the above copyright notice appear in all copies and
      that both that copyright notice and this permission notice appear
      in supporting documentation.

      Permission to modify the software is granted, but not the right to
      distribute the modified code.  Modifications are to be distributed
      as patches to released version.

      This software is provided "as is" without express or implied warranty.

      AUTHORS

        Original Software:
          Thomas Williams,  Colin Kelley.

        Gnuplot 2.0 additions:
            Russell Lang, Dave Kotz, John Campbell.

        Gnuplot 3.0 additions:
            Gershon Elber and many others.

      There is a mailing list for gnuplot users. Note, however, that the
      newsgroup
            comp.graphics.gnuplot
      is identical to the mailing list (they
      both carry the same set of messages). We prefer that you read the
      messages through that newsgroup, to subscribing to the mailing list.
      (If you can read that newsgroup, and are already on the mailing list,
      please send a message info-gnuplot-request@dartmouth.edu, asking to be
      removed from the mailing list.)

      The address for mailing to list members is
            info-gnuplot@dartmouth.edu
      and for mailing administrative requests is
            info-gnuplot-request@dartmouth.edu
      The mailing list for bug reports is
            bug-gnuplot@dartmouth.edu
      The list of those interested in beta-test versions is
            info-gnuplot-beta@dartmouth.edu

introduction
************

   GNUPLOT is a command-driven interactive function plotting program.  It is
case sensitive (commands and function names written in lowercase are not the
same as those written in CAPS). 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 are indicated with quotes.  They
may be either single or double quotation marks, e.g.,

             load "filename"
             cd 'dir'

   Any command-line arguments are assumed to be names of files containing
GNUPLOT commands, with the exception of standard X11 arguments, which are
processed first. Each file is loaded with the `load' command, in the order
specified. GNUPLOT exits after the last file is processed.  When no load files
are named, gnuplot enters into an interactive mode.

   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 `comment').

   In this documentation, curly braces ({}) denote optional arguments to many
commands, 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.

   For help on any topic, type `help' followed by the name of the topic.

   The new GNUPLOT user should begin by reading about the `plot' command (type
`help plot').

cd
**

   The `cd' command changes the working directory.

   Syntax:
            cd "<directory-name>"

   The directory name must be enclosed in quotes.

   Examples:
            cd 'subdir'
            cd ".."

clear
*****

   The `clear' command erases the current screen or output device as specified
by `set output'. This usually generates a formfeed on hardcopy devices. Use
`set terminal' to set the device type.

command line-editing
********************

   The Unix, Atari, VMS, MS-DOS and OS/2 versions of GNUPLOT support command
line-editing.  Also, a history mechanism allows previous commands to be edited,
and re-executed. After the command line has been edited, a newline or carriage
return will enter the entire line regardless of where the cursor is positioned.

   The editing commands are as follows:

     `Line-editing':

     ^B moves back a single character.
     ^F moves forward a single character.
     ^A moves to the beginning of the line.
     ^E moves to the end of the line.
     ^H and DEL delete the previous character.
     ^D deletes the current character.
     ^K deletes from current position to the end of line.
     ^L,^R redraws line in case it gets trashed.
     ^U deletes the entire line.
     ^W deletes the last word.

     `History':

     ^P moves back through history.
     ^N moves forward through history.

   On the IBM PC the use of a TSR program such as DOSEDIT or CED may be desired
for line editing. For such a case GNUPLOT may be compiled with no line editing
capability (default makefile setup). Set READLINE in the makefile and add
readline.obj to the link file if GNUPLOT line editing is to be used for the IBM
PC. The following arrow keys may be used on the IBM PC and Atari versions if
readline is used:

     Left  Arrow     - same as ^B.
     Right Arrow     - same as ^F.
     Ctl Left  Arrow - same as ^A.
     Ctl Right Arrow - same as ^E.
     Up    Arrow     - same as ^P.
     Down  Arrow     - same as ^N.

   The Atari version of readline defines some additional key aliases:

     Undo            - same as ^L.
     Home            - same as ^A.
     Ctrl Home       - same as ^E.
     ESC             - same as ^U.
     Help            - `help' plus return.
     Ctrl Help       - `help '.

   (The readline function in gnuplot is not the same as the readline used in
GNU BASH and GNU EMACS.  It is somewhat compatible however.)

comment
*******

   Comments are supported as follows: a # may appear in most places in a line
and GNUPLOT will ignore the rest of the line. It will not have this effect
inside quotes, inside numbers (including complex numbers), inside command
substitutions, etc. In short, it works anywhere it makes sense to work.

environment
***********

   A number of shell environment variables are understood by GNUPLOT.  None of
these are required, but may be useful.

   If GNUTERM is defined, it is used as the name of the terminal type to be
used. This overrides any terminal type sensed by GNUPLOT on start up, but is
itself overridden by the .gnuplot (or equivalent) start-up file (see
`start-up'), and of course by later explicit changes.

   On Unix, AmigaDOS, AtariTOS, MS-DOS and OS/2, GNUHELP may be defined to be
the pathname of the HELP file (gnuplot.gih).

   On VMS, the symbol GNUPLOT$HELP should be defined as the name of the help
library for GNUPLOT.

   On Unix, HOME is used as the name of a directory to search for a .gnuplot
file if none is found in the current directory.  On AmigaDOS, AtariTOS, MS-DOS
and OS/2, GNUPLOT is used. On VMS, SYS$LOGIN: is used. See `help start-up'.

   On Unix, PAGER is used as an output filter for help messages.

   On Unix, AtariTOS and AmigaDOS, SHELL is used for the `shell' command.  On
MS-DOS and OS/2, COMSPEC is used for the `shell' command.

   On AmigaDOS, GNUFONT is used for the screen font.  For example: "setenv
GNUFONT sapphire/14".

   On MS-DOS, if the BGI interface is used, the variable `BGI' is used to point
to the full path of the BGI drivers directory. Furthermore SVGA is used to name
the Super VGA BGI driver in 800x600 res., and its mode of operation as
'Name.Mode'.  E.g., if the Super VGA driver is C:\TC\BGI\SVGADRV.BGI and mode 3
is used for 800x600 res., then: 'set BGI=C:\TC\BGI' and 'set SVGA=SVGADRV.3'.

exit
****

   The commands `exit' and `quit' and the END-OF-FILE character will exit
GNUPLOT. All these commands will clear the output device (as the `clear'
command does) before exiting.

expressions
***********

   In general, any mathematical expression accepted by C, FORTRAN, Pascal, or
BASIC is valid. The precedence of these operators is determined by the
specifications of the C programming language.  White space (spaces and tabs) is
ignored inside expressions.

   Complex constants may be expressed as the {<real>,<imag>}, where <real> and
<imag> must be numerical constants. For example, {3,2} represents 3 + 2i; {0,1}
represents `i' itself. The curly braces are explicitly required here.

functions
=========

   The functions in GNUPLOT are the same as the corresponding functions in the
Unix math library, except that all functions accept integer, real, and complex
arguments, unless otherwise noted. The `sgn' function is also supported, as in
BASIC.

abs
---

   The `abs' function returns the absolute value of its argument. The returned
value is of the same type as the argument.

   For complex arguments, abs(x) is defined as the length of x in the complex
plane [i.e.,  sqrt(real(x)**2 + imag(x)**2) ].

acos
----

   The `acos' function returns the arc cosine (inverse cosine) of its argument.
`acos' returns its argument in radians.

arg
---

   The `arg' function returns the phase of a complex number, in radians.

asin
----

   The `asin' function returns the arc sin (inverse sin) of its argument.
`asin' returns its argument in radians.

atan
----

   The `atan' function returns the arc tangent (inverse tangent) of its
argument. `atan' returns its argument in radians.

besj0
-----

   The `besj0' function returns the j0th Bessel function of its argument.
`besj0' expects its argument to be in radians.

besj1
-----

   The `besj1' function returns the j1st Bessel function of its argument.
`besj1' expects its argument to be in radians.

besy0
-----

   The `besy0' function returns the y0th Bessel function of its argument.
`besy0' expects its argument to be in radians.

besy1
-----

   The `besy1' function returns the y1st Bessel function of its argument.
`besy1' expects its argument to be in radians.

ceil
----

   The `ceil' function returns the smallest integer that is not less than its
argument. For complex numbers, `ceil' returns the smallest integer not less
than the real part of its argument.

cos
---

   The `cos' function returns the cosine of its argument. `cos' expects its
argument to be in radians.

cosh
----

   The `cosh' function returns the hyperbolic cosine of its argument.  `cosh'
expects its argument to be in radians.

erf
---

   The `erf' function returns the error function of the real part of its
argument.  If the argument is a complex value, the imaginary component is
ignored.

erfc
----

   The `erfc' function returns 1.0 - the error function of the real part of its
argument.  If the argument is a complex value, the imaginary component is
ignored.

exp
---

   The `exp' function returns the exponential function of its argument (`e'
raised to the power of its argument).

floor
-----

   The `floor' function returns the largest integer not greater than its
argument. For complex numbers, `floor' returns the largest integer not greater
than the real part of its argument.

gamma
-----

   The `gamma' function returns the gamma function of the real part of its
argument. For integer n, gamma(n+1) = n! .  If the argument is a complex value,
the imaginary component is ignored.

ibeta
-----

   The `ibeta' function returns the incomplete beta function of the real parts
of its arguments. p, q > 0 and x in [0:1] If the arguments are complex, the
imaginary components are ignored.

inverf
------

   The `inverf' function returns the inverse error function of the real part of
its argument.

igamma
------

   The `igamma' function returns the incomplete gamma function of the real
parts of its arguments. a > 0 and x >= 0 If the arguments are complex, the
imaginary components are ignored.

imag
----

   The `imag' function returns the imaginary part of its argument as a real
number.

invnorm
-------

   The `invnorm' function returns the inverse normal distribution function of
the real part of its argument.

int
---

   The `int' function returns the integer part of its argument, truncated
toward zero.

lgamma
------

   The `lgamma' function returns the natural logarithm of the gamma function of
the real part of its argument.  If the argument is a complex value, the
imaginary component is ignored.

log
---

   The `log' function returns the natural logarithm (base `e') of its argument.

log10
-----

   The `log10' function returns the logarithm (base 10) of its argument.

norm
----

   The `norm' function returns the normal distribution function (or Gaussian)
of the real part of its argument.

rand
----

   The `rand' function returns a pseudo random number in the interval [0:1]
using the real part of its argument as a seed. If seed < 0 the sequence is
(re)initialized.  If the argument is a complex value, the imaginary component
is ignored.

real
----

   The `real' function returns the real part of its argument.

sgn
---

   The `sgn' function returns 1 if its argument is positive, -1 if its argument
is negative, and 0 if its argument is 0. If the argument is a complex value,
the imaginary component is ignored.

sin
---

   The `sin' function returns the sine of its argument. `sin' expects its
argument to be in radians.

sinh
----

   The `sinh' function returns the hyperbolic sine of its argument. `sinh'
expects its argument to be in radians.

sqrt
----

   The `sqrt' function returns the square root of its argument.

tan
---

   The `tan' function returns the tangent of its argument. `tan' expects its
argument to be in radians.

tanh
----

   The `tanh' function returns the hyperbolic tangent of its argument.  `tanh'
expects its argument to be in radians.

operators
=========

   The operators in GNUPLOT are the same as the corresponding operators in the
C programming language, except that all operators accept integer, real, and
complex arguments, unless otherwise noted.  The ** operator (exponentiation) is
supported, as in FORTRAN.

   Parentheses may be used to change order of evaluation.

binary
------

   The following is a list of all the binary operators and their usages:

     Symbol      Example      Explanation
      **          a**b          exponentiation
      *           a*b           multiplication
      /           a/b           division
      %           a%b         * modulo
      +           a+b           addition
      -           a-b           subtraction
      ==          a==b          equality
      !=          a!=b          inequality
      &           a&b         * bitwise AND
      ^           a^b         * bitwise exclusive OR
      |           a|b         * bitwise inclusive OR
      &&          a&&b        * logical AND
      ||          a||b        * logical OR
      ?:          a?b:c       * ternary operation
   (*) Starred explanations indicate that the operator requires integer
arguments.

   Logical AND (&&) and OR (||) short-circuit the way they do in C.  That is,
the second && operand is not evaluated if the first is false; the second ||
operand is not evaluated if the first is true.

   The ternary operator evaluates its first argument (a). If it is true
(non-zero) the second argument (b) is evaluated and returned, otherwise the
third argument (c) is evaluated and returned.

unary
-----

   The following is a list of all the unary operators and their usages:

     Symbol     Example      Explanation
      -           -a          unary minus
      ~           ~a        * one's complement
      !           !a        * logical negation
      !           a!        * factorial
   (*) Starred explanations indicate that the operator requires an integer
argument.

   The factorial operator returns a real number to allow a greater range.

help
****

   The `help' command displays on-line help. To specify information on a
particular topic use the syntax:

            help {<topic>}

   If <topic> is not specified, a short message is printed about GNUPLOT. After
help for the requested topic is given, help for a subtopic may be requested by
typing its name, extending the help request. After that subtopic has been
printed, the request may be extended again, or simply pressing return goes back
one level to the previous topic. Eventually, the GNUPLOT command line will
return.

load
****

   The `load' command executes each line of the specified input file as if it
had been typed in interactively. Files created by the `save' command can later
be `load'ed. Any text file containing valid commands can be created and then
executed by the `load' command.  Files being `load'ed may themselves contain
`load' commands. See `comment' for information about comments in commands.

   The `load' command must be the last command on the line.

   Syntax:
            load "<input-file>"

   The name of the input file must be enclosed in quotes.

   Examples:

            load 'work.gnu'
            load "func.dat"

   The `load' command is performed implicitly on any file names given as
arguments to GNUPLOT. These are loaded in the order specified, and then GNUPLOT
exits.

pause
*****

   The `pause' command displays any text associated with the command and then
waits a specified amount of time or until the carriage return is pressed.
`pause' is especially useful in conjunction with `load' files.

   Syntax:
            pause <time> {"<string>"}

   <time> may be any integer constant or expression. Choosing -1 will wait
until a carriage return is hit, zero (0) won't pause at all, and a positive
integer will wait the specified number of seconds.

   Note: Since `pause' is not part of the plot it may interact with different
device drivers differently (depending upon how text and graphics are mixed).

   Examples:
            pause -1    # Wait until a carriage return is hit
            pause 3     # Wait three seconds
            pause -1  "Hit return to continue"
            pause 10  "Isn't this pretty?  It's a cubic-spline."

plot
****

   `plot' and `splot' are the primary commands of the program. They plot
functions and data in many, many ways. `plot' is used to plot 2-d functions and
data, while `splot' plots 3-d surfaces and data.

   Syntax:

           plot {ranges} {<function> | {"<datafile>" {using ...}}}
                        {title} {style} {, <function> {title} {style}...}

           splot {ranges} {<function> | {"<datafile>" {index i} {using ...}}}
                        {title} {style} {, <function> {title} {style}...}

   where either a <function> or the name of a data file enclosed in quotes is
supplied.  A function is a mathematical expression, or a pair (`plot') or
triple (`splot') of mathematical expressions in the case of parametric
functions.  User-defined functions and variables may also be defined here.

   `plot' and `splot' commands can be as simple as

            plot sin(x)

   and

            splot x * y

   or as complex as (!)

     plot [t=1:10] [-pi:pi*2] tan(t), "data.1" using 2:3 with lines,
           t**2 with points

data-file
=========

   Discrete data contained in a file can be displayed by specifying the name of
the data file (enclosed in quotes) on the `plot' or `splot' command line. Data
files should contain one data point per line.  Lines beginning with # (or ! on
VMS) will be treated as comments and ignored. For `plot's, each data point
represents an (x,y) pair. For `splot's, each point is an (x,y,z) triple. For
`plot's with error bars (see `plot errorbars'), each data point is either
(x,y,ydelta) or (x,y,ylow,yhigh). In all cases, the numbers on each line of a
data file must be separated by blank space. This blank space divides each line
into columns.

   For `plot's the x value may be omitted, and for `splot's the x and y values
may be omitted. In either case the omitted values are assigned the current
coordinate number. Coordinate numbers start at 0 and are incremented for each
data point read.

   To specify other formats, see `plot datafile using'.

   In the `plot' command, blank lines in the data file cause a break in the
plot. There will be no line drawn between the preceding and following points if
the plot style is `lines' or `linespoints' (see `plot style'). This does not
change the plot style, as would plotting the data as separate curves.

   This example compares the data in the file population.dat to a theoretical
curve:

            pop(x) = 103*exp((1965-x)/10)
            plot [1960:1990] 'population.dat', pop(x)

   The file population.dat might contain:

            # Gnu population in Antarctica since 1965
            1965   103
            1970   55
            1975   34
            1980   24
            1985   10

   When a data file is plotted, `samples' and `isosamples' are ignored.  Curves
plotted using the `plot' command are automatically extended to hold the entire
curve. Similarly grid data plotted using the `splot' command is automatically
extended, using the assumption that isolines are separated by blank lines (a
line with only a CR/LF in it).

   Implicitly, there are two types of 3-d datafiles. If all the isolines are of
the same length, the data is assumed to be a grid data, i.e., the data has a
grid topology. Cross isolines in the other parametric direction (the ith cross
isoline passes through the ith point of all the provided isolines) will also be
drawn for grid data. (Note contouring is available for grid data only.) If all
the isolines are not of the same length, no cross isolines will be drawn and
contouring that data is impossible.

   For splot, data files may contain more than one mesh and by default all
meshes are plotted. Meshes are separated from each other, in the file, by
double blank lines. To control and splot a single mesh from a multi mesh file,
use the index modifier. See `splot index' for more.

   For splot if 3-d datafile and using format (see `splot datafile using')
specify only z (height field), a non parametric mode must be specified.  If, on
the other hand, x, y, and z are all specified, a parametric mode should be
selected (see `set parametric') since data is defining a parametric surface.

   A simple example of plotting a 3-d data file is

            set parametric
            splot 'glass.dat'

   or

            set noparametric
            splot 'datafile.dat'

   where the file datafile.dat might contain:

            # The valley of the Gnu.
            10
            10
            10

            10
            5
            10

            10
            1
            10

            10
            0
            10

   Note datafile.dat defines a 4 by 3 grid ( 4 rows of 3 points each ).  Rows
are separated by blank lines.

   On some computer systems with a popen function (UNIX), the datafile can be
piped through a shell command by starting the file name with a '<'.  For
example:

            pop(x) = 103*exp(-x/10)
            plot '< awk "{print $1-1965, $2}" population.dat', pop(x)

   would plot the same information as the first population example but with
years since 1965 as the x axis.  If you want to execute this example, you have
to delete all comments from the data file above or substitute the following
command for the first part of the command above (the part up to the comma):

            plot '< awk "$0 !~ /^#/ {print $1-1965, $2}" population.dat'

   It is also possible to apply a single function to the "y" value only, e.g.

            plot 'population.dat' thru p(x)

   For more information about 3-d plotting, see `splot'.

using
-----

   The format of data within a file can be selected with the `using' option. An
explicit scanf string can be used, or simpler column choices can be made.

   Syntax:

            plot "datafile" { using { <ycol> |
                                      <xcol>:<ycol> |
                                      <xcol>:<ycol>:<ydelta> |
                                      <xcol>:<ycol>:<ylow>:<yhigh> |
                                      <xcol>:<ycol>:<ylow>:<yhigh>:<boxwidth> }
                                    {"<scanf string>"} } ...

   and

            splot "datafile" { using { <xcol>:<ycol>:<zcol> | <zcol> }
                                     {"<scanf string>"} } ...

   <xcol>, <ycol>, and <zcol> explicitly select the columns to plot from a
space or tab separated multicolumn data file. If only <ycol> is selected for
`plot', <xcol> defaults to 1. If only <zcol> is selected for `splot', then only
that column is read from the file. An <xcol> of 0 forces <ycol> to be plotted
versus its coordinate number. <xcol>, <ycol>, and <zcol> can be entered as
constants or expressions.

   If errorbars (see also `plot errorbars') are used for `plot's, ydelta (for
example, a +/- error) should be provided as the third column, or ylow and yhigh
as third and fourth columns.

   If boxes or boxerrorbars are used for `plot's, a fifth column to specify the
width of the box may be given.  This implies that columns three and four must
also be provided even if they are not used.  If you want to plot boxes from a
data file with three columns, set ylow and yhigh to y using the following
command:
            plot "datafile" using 1:2:2:2:3 with boxes

   Scanf strings override any <xcol>:<ycol>(:<zcol>) choices, except for
ordering of input, e.g.,
            plot "datafile" using 2:1 "%f%*f%f"
   causes the first column to be y and the third column to be x.

   If the scanf string is omitted, the default is generated based on the
<xcol>:<ycol>(:<zcol>) choices. If the `using' option is omitted, "%f%f" is
used for `plot' ("%f%f%f%f" for `errorbars' `plot's) and "%f%f%f" is used for
`splot'.

   Examples:

            plot "MyData" using "%*f%f%*20[^\n]%f" with lines

   Data are read from the file "MyData" using the format "%*f%f%*20[^\n]%f".
The meaning of this format is: "%*f" ignore the first number, "%f" then read in
the second and assign to x, "%*20[^\n]" then ignore 20 non-newline characters,
"%f" then read in the y value.

            n=3;
            plot "MyData", "MyData" using n

   causes GNUPLOT to plot the second and third columns of MyData versus the
first column. The command 'n=4; replot' would then plot the second and fourth
columns of MyData versus the first column.

            splot "glass.dat" using 1

   causes GNUPLOT to plot the first coordinate of the points of glass.dat as
the z coordinate while ignoring the other two coordinates.

   Note: GNUPLOT first reads a line of the data file into a buffer and then
does a
            sscanf(input_buffer, scanf_string, &x, &y{, &z});
   where 'x', 'y', and 'z' are of type 'float'. Any scanf string that specifies
two (three for `splot', three or four for `errorbars') float numbers may be
used.

errorbars
=========

   Error bars are supported for 2-d data file plots by reading one or two
additional columns specifying ydelta or ylow and yhigh respectively. No support
exists for x error bars or any error bars for `splot's.

   In the default situation, GNUPLOT expects to see three or four numbers on
each line of the data file, either (x, y, ydelta) or (x, y, ylow, yhigh). The x
coordinate must be specified. The order of the numbers must be exactly as given
above. Data files in this format can easily be plotted with error bars:

            plot "data.dat" with errorbars

   The error bar is a vertical line plotted from (x, ylow) to (x, yhigh). If
ydelta is specified instead of ylow and yhigh, ylow=y-ydelta and yhigh=y+ydelta
are derived. If there are only two numbers on the line, yhigh and ylow are both
set to y. To get lines plotted between the data points, `plot' the data file
twice, once with errorbars and once with lines.

   If y autoscaling is on, the y range will be adjusted to fit the error bars.

   The `using' option may be used to specify how columns of the data file are
to be assigned to x, y, ydelta, ylow, and yhigh. The x column must be provided
and both the x and y columns must appear before the errorbar columns. If three
column numbers are given, they are x, y, and ydelta. If four columns are given,
they are x, y, ylow, and yhigh.

   Examples:

            plot "data.dat" using 1:2:3:4 with errorbars
            plot "data.dat" using 3:2:6 with errorbars
            plot "data.dat" using 3:4:8:7 with errorbars

   The first example reads, x, y, ylow, and yhigh, from columns 1, 2, 3, and 4.
This is equivalent to the default.  The second example reads x from the third
column, y from second and ydelta from the sixth column.  The third example
reads x from the third column, y from the fourth, ylow from the eighth, and
yhigh from seventh columns.

   See also `plot using' and `plot style'.

parametric
==========

   When in parametric mode (`set parametric') mathematical expressions must be
given in pairs for `plot' and in triplets for `splot':
            plot sin(t),t**2
   or
            splot cos(u)*cos(v),cos(u)*sin(v),sin(u)

   Data files are plotted as before, except any preceding parametric function
must be fully specified before a data file is given as a plot. In other words,
the x parametric function (sin(t) above) and the y parametric function (t**2
above) must not be interrupted with any modifiers or data functions; doing so
will generate a syntax error stating that the parametric function is not fully
specified.

   Ranges take on a different meaning when in parametric mode. The first range
on the `plot' command is the `trange', the next is the `xrange', and the last
is the `yrange'. For `splot' the order is `urange', `vrange', `xrange',
`yrange', and finally `zrange'. The following `plot' command shows setting the
`trange' to [-pi:pi], the `xrange' to [-1.3:1.3] and the `yrange' to [-1:1] for
the duration of the plot:
            plot [-pi:pi] [-1.3:1.3] [-1:1] sin(t),t**2

   Other modifiers, such as `with' and `title', may be specified only after the
parametric function has been completed:
            plot sin(t),t**2 title 'Parametric example' with linespoints

ranges
======

   The optional range specifies the region of the plot that will be displayed.

   Ranges may be provided on the `plot' and `splot' command line and affect
only that plot, or in the `set xrange', `set yrange', etc., commands, to change
the default ranges for future plots.

   Syntax:
            [{<dummy-var> =} {<xmin> : <xmax>}] { [{<ymin> : <ymax>}] }

   where <dummy-var> is the independent variable (the defaults are x and y, but
this may be changed with `set dummy') and the min and max terms can be constant
expressions.

   Both the min and max terms are optional. The ':' is also optional if neither
a min nor a max term is specified. This allows '[ ]' to be used as a null range
specification.

   Specifying a range in the `plot' command line turns autoscaling for that
axis off for that plot. Using one of the `set' range commands turns autoscaling
off for that axis for future plots, unless changed later. (See `set autoscale').

   Examples:

   This uses the current ranges:
            plot cos(x)

   This sets the x range only:
            plot [-10:30] sin(pi*x)/(pi*x)

   This is the same, but uses t as the dummy-variable:
            plot [t = -10 :30]  sin(pi*t)/(pi*t)

   This sets both the x and y ranges:
            plot [-pi:pi] [-3:3]  tan(x), 1/x

   This sets only the y range, and turns off autoscaling on both axes:
            plot [ ] [-2:sin(5)*-8] sin(x)**besj0(x)

   This sets xmax and ymin only:
            plot [:200] [-pi:]  exp(sin(x))

   This sets the x, y, and z ranges:
            splot [0:3] [1:4] [-1:1] x*y

index
=====

   Splotting of multi mesh data files can be controlled via the index modifier.
A data file can contain more than one mesh, and in that case all meshes in the
file will be splotted by default. Meshes are separated from each other, in the
data file, by double blank lines. To splot a single mesh in a multi mesh file
use the index modifier which specify which mesh to splot.  First mesh is mesh 0.

   Example:

   splot "data1" index 2 with points

   will splot the third mesh in file data1 with points.

style
=====

   Plots may be displayed in one of eight styles: `lines', `points',
`linespoints', `impulses', `dots', `errorbars', `steps', `boxes', or
`boxerrorbars'.  The `lines' style connects adjacent points with lines.  The
`points' style displays a small symbol at each point.  The `linespoints' style
does both `lines' and `points'.  The `impulses' style displays a vertical line
from the x axis (or from the grid base for `splot') to each point. The `dots'
style plots a tiny dot at each point; this is useful for scatter plots with
many points.

   The `errorbars' style is only relevant to 2-d data file plotting. It is
treated like `points' for `splot's and function `plot's. For data `plot's,
`errorbars' is like `points', except that a vertical error bar is also drawn:
for each point (x,y), a line is drawn from (x,ylow) to (x,yhigh). A tic mark is
placed at the ends of the error bar. The ylow and yhigh values are read from
the data file's columns, as specified with the `using' option to plot. See
`plot errorbars' for more information.

   The `boxes' style is only relevant to 2-d plotting.  Another style called
`boxerrorbars' is also available and is only relevant to 2-d data file
plotting.  This style is a combination of the `boxes' and `errorbars' styles.
The `boxes' style draws a box centred about the given x coordinate from the
yaxis to the given y coordinate.  The width of the box is obtained in one of
three ways.  First, if a data file has a fifth column, this will be used to set
the width of the box. Columns 3 and 4 (for `boxerrorbars') are necessary but
ignored in this instance.  Secondly, if a width has been set using the `set
boxwidth' command, this will be used.  Otherwise the width of each box will be
calculated automatically so that it touches the adjacent boxes.

   The `steps' style is only relevant to 2-d plotting.  This style connects
consecutive points with two line segments: the first from (x1,y1) to (x2,y1)
and the second from (x2,y1) to (x2,y2).

   Default styles are chosen with the `set function style' and `set data style'
commands.

   By default, each function and data file will use a different line type and
point type, up to the maximum number of available types. All terminal drivers
support at least six different point types, and re-use them, in order, if more
than six are required.  The LaTeX driver supplies an additional six point types
(all variants of a circle), and thus will only repeat after twelve curves are
plotted with points.

   If desired, the style and (optionally) the line type and point type used for
a curve can be specified.

   Syntax:

            with <style> {<linetype> {<pointtype>}}

   where <style> is either `lines', `points', `linespoints', `impulses',
`dots', `steps', or `errorbars'. The <linetype> and <pointtype> are positive
integer constants or expressions and specify the line type and point type to be
used for the plot. Line type 1 is the first line type used by default, line
type 2 is the second line type used by default, etc.

   Examples:

   This plots sin(x) with impulses:
            plot sin(x) with impulses

   This plots x*y with points, x**2 + y**2 default:
            splot x*y w points, x**2 + y**2

   This plots tan(x) with the default function style, "data.1" with lines:
            plot [ ] [-2:5] tan(x), "data.1" with l

   This plots "leastsq.dat" with impulses:
            plot 'leastsq.dat' w i

   This plots the data file 'population' with boxes:
            plot "population" with boxes

   This plots "exper.dat" with errorbars and lines connecting the points:
            plot 'exper.dat' w lines, 'exper.dat' w errorbars

   Here 'exper.dat' should have three or four data columns.

   This plots x**2 + y**2 and x**2 - y**2 with the same line type:
            splot x**2 + y**2 with line 1, x**2 - y**2 with line 1

   This plots sin(x) and cos(x) with linespoints, using the same line type but
different point types:
            plot sin(x) with linesp 1 3, cos(x) with linesp 1 4

   This plots file "data" with points style 3:
            plot "data" with points 1 3
   Note that the line style must be specified when specifying the point style,
even when it is irrelevant. Here the line style is 1 and the point style is 3,
and the line style is irrelevant.

   See `set style' to change the default styles.

title
=====

   A title of each plot appears in the key. By default the title is the
function or file name as it appears on the plot command line.  The title can be
changed by using the `title' option. This option should precede any `with'
option.

   Syntax:
            title "<title>"

   where <title> is the new title of the plot and must be enclosed in quotes.
The quotes will not be shown in the key.

   Examples:

   This plots y=x with the title 'x':
            plot x

   This plots the "glass.dat" file with the title 'surface of revolution':
            splot "glass.dat" title 'surface of revolution'

   This plots x squared with title "x^2" and "data.1" with title 'measured
data':
            plot x**2 title "x^2", "data.1" t 'measured data'

   The title can be omitted from the key with the "notitle" option for plot and
splot.  This can be useful when some curves are plotted solely for decoration;
for example, if one wanted a circular border for a polar plot, he could say:

   Example:
           set polar
           plot my_function(x), 1 notitle

   This would generate a key entry for "my_function" but not for "1".  See the
poldat.dem example.

print
*****

   The `print' command prints the value of <expression> to the screen.

   Syntax:
            print <expression>

   See `expressions'.

pwd
***

   The `pwd' command prints the name of the working directory to the screen.

   Syntax:
            pwd

quit
****

   The `exit' and `quit' commands and END-OF-FILE character will exit GNUPLOT.
All these commands will clear the output device (as the `clear' command does)
before exiting.

replot
******

   The `replot' command without arguments repeats the last `plot' or `splot'
command. This can be useful for viewing a plot with different `set' options, or
when generating the same plot for several devices.

   Arguments specified after a `replot' command will be added onto the last
`plot' (`splot') command (with an implied ',' separator) before it is repeated.
`replot' accepts the same arguments as the `plot' (`splot') commands except
that ranges cannot be specified.  See `command line-editing' for ways to edit
the last `plot' (`splot') command.

reread
******

   The `reread' command causes the current gnuplot command file, as specified
by a `load' command or on the command line, to be reset to its starting point
before further commands are read from it.  This essentially implements an
endless loop of the commands from the beginning of the command file to the
`reread' command.  The `reread' command has no effect if input from standard
input.

save
****

   The `save' command saves user-defined functions, variables, set options or
all three plus the last `plot' (`splot') command to the specified file.

   Syntax:
            save  {<option>} "<filename>"

   where <option> is `functions', `variables' or `set'. If no option is used,
GNUPLOT saves functions, variables, set options and the last `plot' (`splot')
command.

   `save'd files are written in text format and may be read by the `load'
command.

   The filename must be enclosed in quotes.

   Examples:

            save "work.gnu"
            save functions 'func.dat'
            save var 'var.dat'
            save set "options.dat"

set-show
********

   The `set' command sets LOTS of options.

   The `show' command shows their settings. `show all' shows all the settings.

set angles
==========

   By default, GNUPLOT assumes the independent variable in polar plots is in
units of radians. If `set angles degrees' is specified before `set polar' then
the default range is [0:360] and the independent variable has units of degrees.
This is particularly useful for plots of data files. The angle setting also
hold for the 3-d mapping as set via the `set mapping' command.

   Syntax:
            set angles { degrees | radians }
            show angles

set arrow
=========

   Arbitrary arrows can be placed on a plot using the `set arrow' command.

   Syntax:

             set arrow {<tag>} {from <sx>,<sy>{,<sz>}}
                               {to <ex>,<ey>{,<ez>}} {{no}head}
             set noarrow {<tag>}
             show arrow

   Unspecified coordinates default to 0. The x, y, and z values are in the
graph's coordinate system. The z coordinate is only used in `splot' commands.
<tag> is an integer that identifies the arrow. If no tag is given, the lowest
unused tag value is assigned automatically.  The tag can be used to delete or
change a specific arrow. To change any attribute of an existing arrow, use the
`set arrow' command with the appropriate tag, and specify the parts of the
arrow to be changed. Specifying nohead requests the arrow be drawn without a
head (yielding a line segment). By default, arrows have heads.

   Arrows outside the plotted boundaries are permitted but may cause device
errors.

   Examples:

   To set an arrow pointing from the origin to (1,2), use:
             set arrow to 1,2
   To set an arrow from (-10,4,2) to (-5,5,3), and tag the arrow number 3, use:
             set arrow 3 from -10,4,2 to -5,5,3
   To change the preceding arrow begin at 1,1,1, without an arrow head, use:
             set arrow 3 from 1,1,1 nohead
   To delete arrow number 2 use:
             set noarrow 2
   To delete all arrows use:
             set noarrow
   To show all arrows (in tag order) use:
             show arrow