(*) 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.
_8._2._2. _U_n_a_r_y
The following is a list of all the unary operators and
their usages:
May 21, 1992
GNUPLOT 3.2 7
_____________________________
|- -a unary minus |
|~ ~a * one's complement |
|! !a * logical negation |
_||!____a_!____*__f_a_c_t_o_r_i_a_l_________||
(*) Starred explanations indicate that the operator
requires an integer argument.
The factorial operator returns a real number to allow a
greater range.
_9. _H_e_l_p
The hhhheeeellllpppp 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 GNU-
PLOT. After help for the requested topic is given, help for a subto-
pic 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.
_1_0. _L_o_a_d
The llllooooaaaadddd command executes each line of the specified input file as
if it had been typed in interactively. Files created by the ssssaaaavvvveeee
command can later be llllooooaaaadddded. Any text file containing valid commands
can be created and then executed by the llllooooaaaadddd command. Files being
llllooooaaaadddded may themselves contain llllooooaaaadddd commands. See ccccoooommmmmmmmeeeennnntttt for infor-
mation about comments in commands.
The llllooooaaaadddd 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'
May 21, 1992
GNUPLOT 3.2 8
load "func.dat"
The llllooooaaaadddd command is performed implicitly on any file names given as
arguments to GNUPLOT. These are loaded in the order specified, and
then GNUPLOT exits.
_1_1. _P_a_u_s_e
The ppppaaaauuuusssseeee command displays any text associated with the command and
then waits a specified amount of time or until the carriage return
is pressed. ppppaaaauuuusssseeee is especially useful in conjunction with llllooooaaaadddd
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 ppppaaaauuuusssseeee is not part of the plot it may interact with dif-
ferent 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."
_1_2. _P_l_o_t
ppppllllooootttt and ssssppppllllooootttt are the primary commands of the program. They plot
functions and data in many, many ways. ppppllllooootttt is used to plot 2-d
functions and data, while ssssppppllllooootttt plots 3-d surfaces and data.
Syntax:
plot {ranges} <function> {title} {style}
{, <function> {title} {style}...}
splot {ranges} <function> {title} {style}
{, <function> {title} {style}...}
where <function> is either a mathematical expression, the name of a
data file enclosed in quotes, or a pair (ppppllllooootttt) or triple (ssssppppllllooootttt) of
May 21, 1992
GNUPLOT 3.2 9
mathematical expressions in the case of parametric functions.
User-defined functions and variables may also be defined here.
ppppllllooootttt and ssssppppllllooootttt 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" with lines,t**2
with points
_1_2._1. _D_a_t_a-_f_i_l_e
Discrete data contained in a file can displayed by specifying
the name of the data file (enclosed in quotes) on the ppppllllooootttt or
ssssppppllllooootttt 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 ppppllllooootttts, each data point represents
an (x,y) pair. For ssssppppllllooootttts, each point is an (x,y,z) triple. For
ppppllllooootttts with error bars (see ppppllllooootttt eeeerrrrrrrroooorrrrbbbbaaaarrrrssss), 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 ppppllllooootttts the x value may be omitted, and for ssssppppllllooootttts 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 ppppllllooootttt ddddaaaattttaaaaffffiiiilllleeee uuuussssiiiinnnngggg.
In the ppppllllooootttt 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 lllliiiinnnneeeessss or lllliiiinnnneeeessssppppooooiiiinnnnttttssss
(see ppppllllooootttt ssssttttyyyylllleeee). 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:
May 21, 1992
GNUPLOT 3.2 10
# Gnu population in Antarctica since 1965
1965 103
1970 55
1975 34
1980 24
1985 10
When a data file is plotted, ssssaaaammmmpppplllleeeessss and iiiissssoooo____ssssaaaammmmpppplllleeeessss are
ignored. Curves plotted using the ppppllllooootttt command are automati-
cally extended to hold the entire curve. Similarly grid data
plotted using the ssssppppllllooootttt 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
thru 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 impos-
sible.
For splot if 3-d datafile and using format (see ssssppppllllooootttt ddddaaaattttaaaaffffiiiilllleeee
uuuussssiiiinnnngggg) 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 sssseeeetttt
ppppaaaarrrraaaammmmeeeettttrrrriiiicccc) 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
May 21, 1992
GNUPLOT 3.2 11
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.
For more information about 3-d plotting, see ssssppppllllooootttt.
_1_2._1._1. _U_s_i_n_g
The format of data within a file can be selected with the
uuuussssiiiinnnngggg 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>
}
{"<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 ppppllllooootttt, <xcol> defaults
to 1. If only <zcol> is selected for ssssppppllllooootttt, then only that
column is read from the file. An <xcol> of 0 forces <ycol>
to be plotted versus its coordinate number. <xcol>,
May 21, 1992
GNUPLOT 3.2 12
<ycol>, and <zcol> can be entered as constants or expres-
sions.
If errorbars (see also ppppllllooootttt eeeerrrrrrrroooorrrrbbbbaaaarrrrssss) are used for ppppllllooootttts,
ydelta (for example, a +/- error) should be provided as
the third column, or ylow and yhigh as third and fourth
columns. These columns must follow the x and y columns.
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 uuuussssiiiinnnngggg
option is omitted, "%f%f" is used for ppppllllooootttt ("%f%f%f%f" for
eeeerrrrrrrroooorrrrbbbbaaaarrrr ppppllllooootttts) and "%f%f%f" is used for ssssppppllllooootttt.
Examples:
plot "MyData" using "%*f%f%*20[^0%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 char-
acters, "%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 ssssppppllllooootttt, three or four
for eeeerrrrrrrroooorrrrbbbbaaaarrrrssss) float numbers may be used.
May 21, 1992
GNUPLOT 3.2 13
_1_2._2. _E_r_r_o_r_b_a_r_s
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 ssssppppllllooootttts.
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, ppppllllooootttt 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 uuuussssiiiinnnngggg 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 ppppllllooootttt uuuussssiiiinnnngggg and ppppllllooootttt ssssttttyyyylllleeee.
_1_2._3. _P_a_r_a_m_e_t_r_i_c
May 21, 1992
GNUPLOT 3.2 14
When in parametric mode (sssseeeetttt ppppaaaarrrraaaammmmeeeettttrrrriiiicccc) mathematical expres-
sions must be given in pairs for ppppllllooootttt and in triplets for
ssssppppllllooootttt:
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 ppppllllooootttt command is the ttttrrrraaaannnnggggeeee, the next is the
xxxxrrrraaaannnnggggeeee, and the last is the yyyyrrrraaaannnnggggeeee. For ssssppppllllooootttt the order is
uuuurrrraaaannnnggggeeee, vvvvrrrraaaannnnggggeeee, xxxxrrrraaaannnnggggeeee, yyyyrrrraaaannnnggggeeee, and finally zzzzrrrraaaannnnggggeeee. The follow-
ing ppppllllooootttt command shows setting the ttttrrrraaaannnnggggeeee to [-pi:pi], the
xxxxrrrraaaannnnggggeeee to [-1.3:1.3] and the yyyyrrrraaaannnnggggeeee 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 wwwwiiiitttthhhh and ttttiiiittttlllleeee, may be specified only
after the parametric function has been completed:
plot sin(t),t**2 title 'Parametric example' with
linespoints
_1_2._4. _R_a_n_g_e_s
The optional range specifies the region of the plot that will
be displayed.
Ranges may be provided on the ppppllllooootttt and ssssppppllllooootttt command line and
affect only that plot, or in the sssseeeetttt xxxxrrrraaaannnnggggeeee, sssseeeetttt yyyyrrrraaaannnnggggeeee, 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 sssseeeetttt dddduuuummmmmmmmyyyy) 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.
May 21, 1992
GNUPLOT 3.2 15
Specifying a range in the ppppllllooootttt command line turns autoscaling
for that axis off for that plot. Using one of the sssseeeetttt range
commands turns autoscaling off for that axis for future plots,
unless changed later. (See sssseeeetttt aaaauuuuttttoooossssccccaaaalllleeee).
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
_1_2._5. _S_t_y_l_e
Plots may be displayed in one of six styles: lllliiiinnnneeeessss, ppppooooiiiinnnnttttssss,
lllliiiinnnneeeessssppppooooiiiinnnnttttssss, iiiimmmmppppuuuullllsssseeeessss, ddddoooottttssss, or eeeerrrrrrrroooorrrrbbbbaaaarrrrssss. The lllliiiinnnneeeessss style con-
nects adjacent points with lines. The ppppooooiiiinnnnttttssss style displays a
small symbol at each point. The lllliiiinnnneeeessssppppooooiiiinnnnttttssss style does both
lllliiiinnnneeeessss and ppppooooiiiinnnnttttssss. The iiiimmmmppppuuuullllsssseeeessss style displays a vertical line
from the x axis (or from the grid base for ssssppppllllooootttt) to each
point. The ddddoooottttssss style plots a tiny dot at each point; this is
useful for scatter plots with many points.
The eeeerrrrrrrroooorrrrbbbbaaaarrrrssss style is only relevant to 2-d data file plotting.
It is treated like ppppooooiiiinnnnttttssss for ssssppppllllooootttts and function ppppllllooootttts. For
data ppppllllooootttts, eeeerrrrrrrroooorrrrbbbbaaaarrrrssss is like ppppooooiiiinnnnttttssss, 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 uuuussssiiiinnnngggg option to plot. See
ppppllllooootttt eeeerrrrrrrroooorrrrbbbbaaaarrrrssss for more information.
Default styles are chosen with the sssseeeetttt ffffuuuunnnnccccttttiiiioooonnnn ssssttttyyyylllleeee and sssseeeetttt
May 21, 1992
GNUPLOT 3.2 16
ddddaaaattttaaaa ssssttttyyyylllleeee 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 lllliiiinnnneeeessss, ppppooooiiiinnnnttttssss, lllliiiinnnneeeessssppppooooiiiinnnnttttssss, iiiimmmmppppuuuullllsssseeeessss,
ddddoooottttssss, or eeeerrrrrrrroooorrrrbbbbaaaarrrrssss. 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 "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
May 21, 1992
GNUPLOT 3.2 17
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 sssseeeetttt ssssttttyyyylllleeee to change the default styles.
_1_2._6. _T_i_t_l_e
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 ttttiiiittttlllleeee option. This
option should precede any wwwwiiiitttthhhh 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'
_1_3. _P_r_i_n_t
The pppprrrriiiinnnntttt command prints the value of <expression> to the screen.
Syntax:
print <expression>
See eeeexxxxpppprrrreeeessssssssiiiioooonnnnssss.
_1_4. _P_w_d
The ppppwwwwdddd command prints the name of the working directory to the
May 21, 1992
GNUPLOT 3.2 18
screen.
Syntax:
pwd
_1_5. _Q_u_i_t
The eeeexxxxiiiitttt and qqqquuuuiiiitttt commands and END-OF-FILE character will exit GNU-
PLOT. All these commands will clear the output device (as the cccclllleeeeaaaarrrr
command does) before exiting.
_1_6. _R_e_p_l_o_t
The rrrreeeeppppllllooootttt command without arguments repeats the last ppppllllooootttt or ssssppppllllooootttt
command. This can be useful for viewing a plot with different sssseeeetttt
options, or when generating the same plot for several devices.
Arguments specified after a rrrreeeeppppllllooootttt command will be added onto the
last ppppllllooootttt (ssssppppllllooootttt) command (with an implied ',' separator) before it
is repeated. rrrreeeeppppllllooootttt accepts the same arguments as the ppppllllooootttt (ssssppppllllooootttt)
commands except that ranges cannot be specified. See ccccoooommmmmmmmaaaannnndddd----lllliiiinnnneeee
eeeeddddiiiittttiiiinnnngggg for ways to edit the last ppppllllooootttt (ssssppppllllooootttt) command.
_1_7. _S_a_v_e
The ssssaaaavvvveeee command saves user-defined functions, variables, set
options or all three plus the last ppppllllooootttt (ssssppppllllooootttt) command to the
specified file.
Syntax:
save {<option>} "<filename>"
where <option> is ffffuuuunnnnccccttttiiiioooonnnnssss, vvvvaaaarrrriiiiaaaabbbblllleeeessss or sssseeeetttt. If no option is used,
GNUPLOT saves functions, variables, set options and the last ppppllllooootttt
(ssssppppllllooootttt) command.
ssssaaaavvvveeeed files are written in text format and may be read by the llllooooaaaadddd
command.
The filename must be enclosed in quotes.
Examples:
save "work.gnu"
May 21, 1992
GNUPLOT 3.2 19
save functions 'func.dat'
save var 'var.dat'
save set "options.dat"
_1_8. _S_e_t-_s_h_o_w
The sssseeeetttt command sets LOTS of options.
The sssshhhhoooowwww command shows their settings. sssshhhhoooowwww aaaallllllll shows all the set-
tings.
_1_8._1. _A_n_g_l_e_s
By default, GNUPLOT assumes the independent variable in polar
plots is in units of radians. If sssseeeetttt aaaannnngggglllleeeessss ddddeeeeggggrrrreeeeeeeessss is speci-
fied before sssseeeetttt ppppoooollllaaaarrrr 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 sssseeeetttt mmmmaaaappppppppiiiinnnngggg command.
Syntax:
set angles { degrees | radians }
show angles
_1_8._2. _A_r_r_o_w
Arbitrary arrows can be placed on a plot using the sssseeeetttt aaaarrrrrrrroooowwww
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 ssssppppllllooootttt 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
May 21, 1992
GNUPLOT 3.2 20
arrow, use the sssseeeetttt aaaarrrrrrrroooowwww 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
_1_8._3. _A_u_t_o_s_c_a_l_e
Auto scaling may be set individually on the x, y or z axis or
globally on all axes. The default is to autoscale all axes.
When autoscaling, the plot range is automatically computed and
the dependent axis (y for a ppppllllooootttt and z for ssssppppllllooootttt) is scaled to
include the range of the function or data being plotted.
If autoscaling of the dependent axis (y or z) is not set, the
current y or z range is used.
See sssseeeetttt yyyyrrrraaaannnnggggeeee or sssseeeetttt zzzzrrrraaaannnnggggeeee.
Autoscaling the independent variables (x for ppppllllooootttt and x,y for
ssssppppllllooootttt) is a request to set the domain to match any data file
being plotted. If there are no data files then autoscaling an
independent variable has no effect. In other words, in the
absence of a data file, functions alone do not affect the x
range (or the y range if plotting z = f(x,y)).
See sssseeeetttt xxxxrrrraaaannnnggggeeee, or sssseeeetttt yyyyrrrraaaannnnggggeeee.
The behavior of autoscaling remains consistent in parametric
mode, however, there are more dependent variables and hence
May 21, 1992
GNUPLOT 3.2 21
more control over x, y, and z plot scales. In parametric mode,
the independent or dummy variable is t for ppppllllooootttts and u,v for
ssssppppllllooootttts. Autoscale in parametric mode, then, controls all
ranges (t, u, v, x, y, and z) and allows x, y, and z to be
fully autoscaled.
See sssseeeetttt ppppaaaarrrraaaammmmeeeettttrrrriiiicccc.
Syntax:
set autoscale <axes>
set noautoscale <axes>
show autoscale
where <axes> is either xxxx, yyyy, zzzz or xxxxyyyy. If <axes> is not given
then all axes are assumed.
Examples:
This sets autoscaling of the y axis. x axis autoscaling is not
affected.
set autoscale y
This sets autoscaling of the x and y axes.
set autoscale xy
This sets autoscaling of the x, y and z axes.
set autoscale
This disables autoscaling of the x, y and z axes.
set noautoscale
This disables autoscaling of the z axis only.
set noautoscale z
_1_8._3._1. _P_a_r_a_m_e_t_r_i_c _m_o_d_e
When in parametric mode (sssseeeetttt ppppaaaarrrraaaammmmeeeettttrrrriiiicccc) the xrange is as
fully scalable as the yrange. In other words, in
parametric mode the x axis can be automatically scaled to
fit the range of the parametric function that is being
plotted. Of course, the y axis can also be automatically
scaled just as in the non-parametric case. If autoscaling
on the x axis is not set, the current x range is used.
When there is a mix of data files and functions, the
xrange of the functions is selected as that of the data
files if autoscale is true for x. While this keeps the
behavior compatible with non-parametric plotting, it may
not be retained in the future. The problem is that, in
May 21, 1992
GNUPLOT 3.2 22
parametric mode, the x and y ranges are not as distin-
guishable as in the non-parametric mode and this behavior
may not be the most useful.
For completeness a last command sssseeeetttt aaaauuuuttttoooossssccccaaaalllleeee tttt is
accepted. However, the effect of this "scaling" is very
minor. When GNUPLOT determines that the t range would be
empty it makes a small adjustment if autoscaling is true.
Otherwise, GNUPLOT gives an error. Such behavior may, in
fact, not be very useful and the command sssseeeetttt aaaauuuuttttoooossssccccaaaalllleeee tttt
is certainly questionable.
ssssppppllllooootttt extends the above idea similarly. If autoscaling is
set then x, y, and z ranges are computed and each axis
scaled to fit the resulting data.
_1_8._4. _B_o_r_d_e_r
The sssseeeetttt bbbboooorrrrddddeeeerrrr and sssseeeetttt nnnnoooobbbboooorrrrddddeeeerrrr commands controls the display
of the plot borders for the ppppllllooootttt and ssssppppllllooootttt commands.
Syntax:
set border
set noborder
show border
_1_8._5. _C_l_i_p
GNUPLOT can clip data points and lines that are near the boun-
daries of a plot.
Syntax:
set clip <clip-type>
set noclip <clip-type>
show clip
Three clip types are supported by GNUPLOT: ppppooooiiiinnnnttttssss, oooonnnneeee, and
ttttwwwwoooo. One, two, or all three clip types may be active for a
single plot.
The ppppooooiiiinnnnttttssss clip type forces GNUPLOT to clip (actually, not plot
at all) data points that fall within but too close to the boun-
daries (this is so the large symbols used for points will not
extend outside the boundary lines). Without clipping points
near the boundaries may look bad; try adjusting the x and y
ranges.
May 21, 1992
GNUPLOT 3.2 23
Setting the oooonnnneeee clip type causes GNUPLOT to plot the line seg-
ments which have only one of the two endpoints with the plot-
ting region. Only the in-range portion of the line is drawn.
The alternative is to not draw any portion of the line segment.
Some lines may have both endpoints out of range, but pass
through the plotting area. Setting the ttttwwwwoooo clip-type allows the
visible portion of these lines to be drawn.
In no case is a line drawn outside the plotting area.
The defaults are nnnnoooocccclllliiiipppp ppppooooiiiinnnnttttssss, cccclllliiiipppp oooonnnneeee, and nnnnoooocccclllliiiipppp ttttwwwwoooo.
To check the state of all forms of clipping, use
show clip
For backward compatibility with older versions, the following
forms are also permitted.
set clip
set noclip
sssseeeetttt cccclllliiiipppp is synonymous with sssseeeetttt cccclllliiiipppp ppppooooiiiinnnnttttssss. sssseeeetttt nnnnoooocccclllliiiipppp turns
off all three types of clipping.
_1_8._6. _C_n_t_r_p_a_r_a_m
Sets the different parameters for the contouring plot (see also
ccccoooonnnnttttoooouuuurrrr).
Syntax:
set cntrparam { { linear | cubicspline | bspline } |
points <n> |
levels <n> |
order <n> }
This command controls the way contours are plotted. <n> should
be an integral constant expression. The parameters are:
lllliiiinnnneeeeaaaarrrr, ccccuuuubbbbiiiiccccsssspppplllliiiinnnneeee, bbbbsssspppplllliiiinnnneeee - Controls type of approximation
or interpolation. If lllliiiinnnneeeeaaaarrrr, then the contours are drawn piece-
wise linear, as extracted from the surface directly. If
ccccuuuubbbbiiiiccccsssspppplllliiiinnnneeee, then piecewise linear contours are interpolated to
form a somewhat smoother contours, but which may undulate. The
third option is the uniform bbbbsssspppplllliiiinnnneeee, which only approximates
the piecewise linear data but is guaranteed to be smoother.
ppppooooiiiinnnnttttssss - Eventually all drawings are done with piecewise linear
strokes. This number controls the number of points used to
approximate a curve. Relevant for ccccuuuubbbbiiiiccccsssspppplllliiiinnnneeee and bbbbsssspppplllliiiinnnneeee
modes only.
May 21, 1992
GNUPLOT 3.2 24
lllleeeevvvveeeellllssss - Number of contour levels. If the surface is bounded by
zmin and zmax then contours will be generated from zmin+dz to
zmax-dz in steps of size dz, where dz = (zmax - zmin) / (levels
+ 1).
oooorrrrddddeeeerrrr - Order of the bspline approximation to be used. The
bigger this order is, the smoother the resulting contour. (Of
course, higher order bspline curves will move further away from
the original peicewise linear data.) This option is relevant
for bbbbsssspppplllliiiinnnneeee mode only. Allowed values are integers in the range
from 2 (linear) to 10.
_1_8._7. _C_o_n_t_o_u_r
Enable contour drawing for surfaces. This option is available
for ssssppppllllooootttt only.
Syntax:
set contour { base | surface | both }
set nocontour
If no option is provided to sssseeeetttt ccccoooonnnnttttoooouuuurrrr, the default is bbbbaaaasssseeee.
The three options specify where to draw the contours: bbbbaaaasssseeee
draws the contours on the grid base where the x/ytics are
placed, ssssuuuurrrrffffaaaacccceeee draws the contours on the surfaces themselves,
and bbbbooootttthhhh draws the contours on both the base and the surface.
See also sssseeeetttt ccccnnnnttttrrrrppppaaaarrrraaaammmm for the parameters that affect the draw-
ing of contours.
_1_8._8. _D_a_t_a _s_t_y_l_e
The sssseeeetttt ddddaaaattttaaaa ssssttttyyyylllleeee command changes the default plotting style
for data plots.
Syntax:
set data style
show data style
set data style <style-choice>
In the first case, sssseeeetttt ddddaaaattttaaaa ssssttttyyyylllleeee returns the possible style
choices: lllliiiinnnneeeessss, ppppooooiiiinnnnttttssss, lllliiiinnnneeeessssppppooooiiiinnnnttttssss, ddddoooottttssss, iiiimmmmppppuuuullllsssseeeessss, or eeeerrrrrrrroooorrrr----
bbbbaaaarrrrssss. sssshhhhoooowwww ddddaaaattttaaaa ssssttttyyyylllleeee shows the current default plotting style
for data. sssseeeetttt ddddaaaattttaaaa ssssttttyyyylllleeee ddddoooottttssss would actually change the
default plotting style. See also ppppllllooootttt.
May 21, 1992
GNUPLOT 3.2 25
_1_8._9. _D_u_m_m_y
By default, GNUPLOT assumes that the independent variable for
the ppppllllooootttt command is x, and the independent variables for the
ssssppppllllooootttt command are x and y. They are called the dummy variables
because it is just a notation to indicate the independent vari-
ables. The sssseeeetttt dddduuuummmmmmmmyyyy command changes these default dummy vari-
able names. For example, it may be more convenient to call the
dummy variable t when plotting time functions:
set dummy t
plot sin(t), cos(t)
Syntax:
set dummy <dummy-var>{,<dummy-var>}
show dummy
Examples:
set dummy u,v
set dummy ,s
to set both dummy variables to u and v or set only the second
variable to s.
The sssseeeetttt ppppaaaarrrraaaammmmeeeettttrrrriiiicccc command also changes the dummy variables (to
t for ppppllllooootttt and u,v for ssssppppllllooootttts).
_1_8._1_0. _F_o_r_m_a_t
The format of the tic-mark labels can be set with the sssseeeetttt ffffoooorrrr----
mmmmaaaatttt command. The default format for both axes is "%g", but
other formats such as "%.2f" or "%3.0fm" are often desirable.
Anything accepted by printf when given a double precision
number, and then accepted by the terminal, will work. In par-
ticular, the formats f, e, and g will work, and the d, o, x, c,
s, and u formats will not work.
Syntax:
set format {<axes>} {"<format-string>"}
show format
where <axes> is either xxxx, yyyy, zzzz, xxxxyyyy, or nothing (which is the
same as xxxxyyyy). The length of the string representing a ticmark
(after formatting with printf) is restricted to 100 characters.
If the format string is omitted, the format will be returned to
the default "%g". For LaTeX users, the format "$%g$" is often
desirable. If the empty string "" is used, no label will be
plotted with each tic, though the tic mark will still be
May 21, 1992
GNUPLOT 3.2 26
plotted. To eliminate all tic marks, use sssseeeetttt nnnnooooxxxxttttiiiiccccssss or sssseeeetttt
nnnnooooyyyyttttiiiiccccssss.
See also sssseeeetttt xxxxttttiiiiccccssss and sssseeeetttt yyyyttttiiiiccccssss for more control over tic
labels.
_1_8._1_1. _F_u_n_c_t_i_o_n _s_t_y_l_e
The sssseeeetttt ffffuuuunnnnccccttttiiiioooonnnn ssssttttyyyylllleeee command changes the default plotting
style for functions.
Syntax:
set function style
show function style
set function style <style-choice>
In the first case, sssseeeetttt ffffuuuunnnnccccttttiiiioooonnnn ssssttttyyyylllleeee returns the possible
style choices: lllliiiinnnneeeessss, ppppooooiiiinnnnttttssss, lllliiiinnnneeeessssppppooooiiiinnnnttttssss, ddddoooottttssss, iiiimmmmppppuuuullllsssseeeessss, or
eeeerrrrrrrroooorrrrbbbbaaaarrrrssss. sssshhhhoooowwww ffffuuuunnnnccccttttiiiioooonnnn ssssttttyyyylllleeee shows the current default plot-
ting style for functions. sssseeeetttt ffffuuuunnnnccccttttiiiioooonnnn ssssttttyyyylllleeee lllliiiinnnneeeessssppppooooiiiinnnnttttssss would
actually change the default plotting style. See also ppppllllooootttt.
_1_8._1_2. _F_u_n_c_t_i_o_n_s
The sssshhhhoooowwww ffffuuuunnnnccccttttiiiioooonnnnssss command lists all user-defined functions and
their definitions.
Syntax:
show functions
_1_8._1_3. _G_r_i_d
The optional sssseeeetttt ggggrrrriiiidddd draws a grid at the tic marks with the
axis linetype.
Syntax:
set grid
set nogrid
show grid
May 21, 1992
GNUPLOT 3.2 27
_1_8._1_4. _H_i_d_d_e_n_3_d
The sssseeeetttt hhhhiiiiddddddddeeeennnn3333dddd command enables hidden line removal for expli-
cit surface plotting (see ssssppppllllooootttt). Hidden line removal may be
used for both explicit functions and for explicit data where
gnuplot plot is in nonparametric mode (see sssseeeetttt ppppaaaarrrraaaammmmeeeettttrrrriiiicccc).
When this flag is set both the surface hidden portion and pos-
sibly its hidden contours (see sssseeeetttt ccccoooonnnnttttoooouuuurrrr) as well as the hid-
den grid will be removed. Labels and arrows are always visible
and are unaffected by this command.
Each surface has its hidden part removed with respect to
itself, if more than one surface is ploted. This mode is mean-
ingfull when surfaces are plotted using line style drawing
only.
Syntax:
set hidden3d
set nohidden3d
show hidden3d
_1_8._1_5. _I_s_o_s_a_m_p_l_e_s
An isoline is a curve parametrized by one of the surface param-
eters while the other surface parameter is fixed. Isolines are
a simple means to display a surface. By fixing the u parameter
of surface s(u,v), the iso-u lines of the form c(v) = s(u0,v)
are produced, and by fixing the v parameter, the iso-v lines of
the form c(u) = s(u,v0) are produced.
The isoline density of surfaces may be changed by the sssseeeetttt iiiissssoooo----
ssssaaaammmmpppplllleeeessss command. By default, sampling is set to 10 isolines per
u or v axis. A higher sampling rate will produce more accurate
plots, but will take longer. This parameter has no effect on
data file plotting.
Syntax:
set isosamples <expression>
show isosamples
_1_8._1_6. _K_e_y
The sssseeeetttt kkkkeeeeyyyy enables a key describing curves on a plot. By
default the key is placed in the upper right corner of the
plot.
May 21, 1992
GNUPLOT 3.2 28
Syntax:
set key
set key <x>,<y>{,<z>}
set nokey
show key
The coordinates <x>, <y> (and <z> for ssssppppllllooootttts) specify the loca-
tion of the key on the plot. The key is drawn as a sequence of
lines, with one plot described on each line. On the right hand
side of each line is a representation that attempts to mimic
the way the curve is plotted. On the left side of each line is
the text description, obtained from the ppppllllooootttt command. See ppppllllooootttt
ttttiiiittttlllleeee to change this description. The lines are vertically
arranged so an imaginary straight line divides the left- and
right-hand sides of the key. It is the coordinates of this line
that are specified with the sssseeeetttt kkkkeeeeyyyy command. In a ppppllllooootttt, only
the x and y coordinates are used to specify the line position.
For a ssssppppllllooootttt, x, y and z are all being used as a 3-d location
mapped using the same mapping as the plot itself to form the
required 2-d screen position of the imaginary line.
Some or all of the key may be outside of the plot boundary,
although this may interfere with other labels and may cause an
error on some devices.
Examples:
This places the key at the default location:
set key
This disables the key:
set nokey
This places a key at coordinates 2,3.5,2
set key 2,3.5,2
_1_8._1_7. _L_a_b_e_l
Arbitrary labels can be placed on the plot using the sssseeeetttt llllaaaabbbbeeeellll
command. If the z coordinate is given on a ppppllllooootttt it is ignored;
if it is missing on a ssssppppllllooootttt it is assumed to be 0.
Syntax:
set label {<tag>} {"<label_text>"} {at <x>,<y>{,<z>}}
{<justification>}
set nolabel {<tag>}
show label
The text defaults to "", and the position to 0,0,0. The <x>,
<y>, and <z> values are in the graph's coordinate system. The
May 21, 1992
GNUPLOT 3.2 29
tag is an integer that is used to identify the label. If no
<tag> is given, the lowest unused tag value is assigned
automatically. The tag can be used to delete or change a
specific label. To change any attribute of an existing label,
use the sssseeeetttt llllaaaabbbbeeeellll command with the appropriate tag, and specify
the parts of the label to be changed.
By default, the text is placed flush left against the point
x,y,z. To adjust the way the label is positioned with respect
to the point x,y,z, add the parameter <justification>, which
may be lllleeeefffftttt, rrrriiiigggghhhhtttt or cccceeeennnntttteeeerrrr, indicating that the point is to
be at the left, right or center of the text. Labels outside the
plotted boundaries are permitted but may interfere with axes
labels or other text.
Examples:
To set a label at (1,2) to "y=x" use:
set label "y=x" at 1,2
To set a label "y=x^2" with the right of the text at (2,3,4),
and tag the label number 3, use:
set label 3 "y=x^2" at 2,3,4 right
To change the preceding label to center justification, use:
set label 3 center
To delete label number 2 use:
set nolabel 2
To delete all labels use:
set nolabel
To show all labels (in tag order) use:
show label
(The Latex, EEPIC, and Imagen drivers allow \\ in a string to
specify a newline.)
_1_8._1_8. _L_o_g_s_c_a_l_e
Log scaling may be set on the x, y, and z axes.
Syntax:
set logscale <axes>
set nologscale <axes>
show logscale
where <axes> may be any combinations of xxxx, yyyy, and zzzz, in any
order. If <axes> is not given then all three axes are assumed.
The command sssseeeetttt llllooooggggssssccccaaaalllleeee turns on log scaling on the specified
axes, while sssseeeetttt nnnnoooollllooooggggssssccccaaaalllleeee turns off log scaling.
Examples:
May 21, 1992
GNUPLOT 3.2 30
To enable log scaling in both x and z axes:
set logscale xz
To disable z axis log scaling:
set nologscale z
_1_8._1_9. _M_a_p_p_i_n_g
Syntax:
set mapping { cartesian | spherical | cylindrical }
Data for ssssppppllllooootttts are usually in regular Euclidean space and are
provided in Cartesian coordinates. Such 3-d data require three
coordinates (x, y and z) or one coordinate (only z) in each
line in the data file. In order to be able to use spherical or
cylindrical coordinate systems, use the sssseeeetttt mmmmaaaappppppppiiiinnnngggg command. In
both cases two coordinates are expected in each line of the
data. For a spherical coordinate system, these are theta and
phi (in units as specified by sssseeeetttt aaaannnngggglllleeeessss) and the mapping is:
x = cos( theta ) * cos( phi )
y = sin( theta ) * cos( phi )
z = sin( phi )
For a cylindrical coordinate system, the mapping uses two vari-
ables, theta (in units as specified by sssseeeetttt aaaannnngggglllleeeessss) and z:
x = cos( theta )
y = sin( theta )
z = z
Again, note that mapping will affect data file ssssppppllllooootttts only.
_1_8._2_0. _O_f_f_s_e_t_s
The amount of the graph that the plot takes up may be con-
trolled to some extent with the sssseeeetttt ooooffffffffsssseeeettttssss command. This com-
mand takes four offset arguments: <left>, <right>, <top> and
<bottom>. By default, each offset is 0. Each offset may be a
constant or an expression. Left and right offsets are given in
units of the x axis, while top and bottom offsets are given in
units of the y axis. The plot of sin(x), displayed with offsets
of 0, 0, 2, 2 will take up 1/3 of the displayed y axis. Offsets
are particularly useful with polar coordinates as a means of
compensating for aspect ratio distortion. Offsets are ignored
in ssssppppllllooootttts.
May 21, 1992
GNUPLOT 3.2 31
Syntax:
set offsets <left>, <right>, <top>, <bottom>
show offsets
_1_8._2_1. _O_u_t_p_u_t
By default, plots are displayed to the standard output. The sssseeeetttt
oooouuuuttttppppuuuutttt command redirects the display to the specified file or
device.
Syntax:
set output {"<filename>"}
show output
The filename must be enclosed in quotes. If the filename is
omitted, output will be sent to the standard output.
On machines with popen functions (UNIX), output can be piped
through a shell command if the first letter of the filename is
'|'. For instance,
Syntax:
set output "|lpr -Plaser filename"
set output "|lp -dlaser filename"
(On MSDOS machines, set output "prn" will direct the output to
the default printer.)
_1_8._2_2. _P_a_r_a_m_e_t_r_i_c
The sssseeeetttt ppppaaaarrrraaaammmmeeeettttrrrriiiicccc command changes the meaning of ppppllllooootttt (ssssppppllllooootttt)
from normal functions to parametric functions. The command sssseeeetttt
nnnnooooppppaaaarrrraaaammmmeeeettttrrrriiiicccc changes the plotting style back to normal,
single-valued expression plotting.
In 2-d plotting, a parametric function is determined by a pair
of parametric functions operating on a parameter. An example of
a 2-d parametric function would be plot sin(t),cos(t) (which
defines a circle).
For 3-d plotting, the surface is described as x=f(u,v),
y=g(u,v), z=h(u,v). Therefore a triplet of functions are
required. An example of 3-d parametric function would be
cos(u)*cos(v),cos(u)*sin(v),sin(u) (which defines a sphere). It
takes three parametric function specifications in terms of the
parametric dummy arguments to describe a single graph.
May 21, 1992
GNUPLOT 3.2 32
The total set of possible plots is a superset of the simple
f(x) style plots, since the two (three) functions can describe
the x and y (and z) values to be computed separately. In fact,
plots of the type t,f(t) (u,v,f(u,v)) are equivalent to those
produced with f(x) when the x values are computed using the
identity function as the first function.
Note that the order the parametric functions are specified is
xfunction, yfunction (and zfunction) and that each operates
over the common parametric domain.
Also, the sssseeeetttt ppppaaaarrrraaaammmmeeeettttrrrriiiicccc function implies a new range of
values. Whereas the normal f(x) and f(x,y) style plotting
assume an xrange and yrange (and zrange), the parametric mode
additionally specifies a trange, urange, and vrange. These
ranges may be set directly with sssseeeetttt ttttrrrraaaannnnggggeeee, sssseeeetttt uuuurrrraaaannnnggggeeee and sssseeeetttt
vvvvrrrraaaannnnggggeeee, or by specifying the range on the ppppllllooootttt or ssssppppllllooootttt com-
mands. Currently the default range for these parametric vari-
ables is [-5:5]. Setting the ranges to something more meaning-
ful is expected.
_1_8._2_3. _P_o_l_a_r
The sssseeeetttt ppppoooollllaaaarrrr command changes the meaning of the plot from rec-
tangular coordinates to polar coordinates. In polar coordi-
nates, the dummy variable (x) is an angle. The range of this
angle is changed from whatever it was to [0:2*pi], or, if
degree unit has been selected, to [0:360] (see sssseeeetttt aaaannnngggglllleeeessss).
The command sssseeeetttt nnnnooooppppoooollllaaaarrrr changes the meaning of the plot back to
the default rectangular coordinate system. The range of x is
changed from whatever it was to [-10:10].
The sssseeeetttt ppppoooollllaaaarrrr command is not supported for ssssppppllllooootttts. See the sssseeeetttt
mmmmaaaappppppppiiiinnnngggg command for similar functionality for ssssppppllllooootttts.
While in polar coordinates the meaning of an expression in x is
really r = f(x), where x is an angle of rotation. The xrange
controls the domain (the angle) of the function, and the yrange
controls the range (the radius). The plot is plotted in a rec-
tangular box, and the x and y axes are both in units of the
radius. Thus, the yrange controls both dimensions of the plot
output. The tics and units are written along the axes rather
than at the left and bottom. These unit are offset by <rmin>
specified by the rrrrrrrraaaannnnggggeeee (See sssseeeetttt rrrrrrrraaaannnnggggeeee). It is not possible to
specify different output dimensions in the x or y directions.
The yrange can be used to shift the plot diagonally to display
only the first or third quadrants.
Syntax:
May 21, 1992
GNUPLOT 3.2 33
set polar
set nopolar
show polar
Example:
set polar
plot x*sin(x)
plot [-2*pi:2*pi] [-3:3] x*sin(x)
The first plot uses the default polar angular domain of 0 to
2*pi. The radius (and the size of the plot) is scaled automat-
ically. The second plot expands the domain, and restricts the
range of the radius (and the size of the plot) to [-3:3].
_1_8._2_4. _R_r_a_n_g_e
The sssseeeetttt rrrrrrrraaaannnnggggeeee command sets the radial range used to compute x
and y values when in polar mode. If not in polar mode (see sssseeeetttt
ppppoooollllaaaarrrr) then this range is not used. Use of this command offsets
the polar singularity to the <rmin> value and shifts the units
on the axes tic marks. For instance, sssseeeetttt rrrrrrrraaaannnnggggeeee [[[[----44440000::::44440000]]]] would
set the origin to -40 and would plot values of radial values
between -40 to 40. Thus, if 360 degrees of data were plotted,
then the plot would extend 80 units in radially from the ori-
gin. To view the entire plot, a sssseeeetttt yyyyrrrraaaannnnggggeeee [[[[----88880000::::88880000]]]] command
would create a square viewport with a circular plot tangent at
the axes. Because xxxxrrrraaaannnnggggeeee is used specify the angular extent,
only a square viewport can be specified by yyyyrrrraaaannnnggggeeee. For
instance, sssseeeetttt yyyyrrrraaaannnnggggeeee [[[[0000::::88880000]]]] would display the first quadrant
and sssseeeetttt yyyyrrrraaaannnnggggeeee [[[[----88880000::::0000]]]] would display the third quadrant. Any
square viewport of any size can be specified but it is con-
strained to be centered on a 45 degree line.
This range may also be specified on the ppppllllooootttt command line when
in polar mode.
Syntax:
set rrange [{<rmin> : <rmax>}]
where <rmin> and <rmax> terms are constants or expressions.
Both the <rmin> and <rmax> terms are optional. Anything omitted
will not be changed, so
set rrange [:10]
changes rmax to 10 without affecting rmin.
_1_8._2_5. _S_a_m_p_l_e_s
The sampling rate of functions may be changed by the sssseeeetttt
May 21, 1992
GNUPLOT 3.2 34
ssssaaaammmmpppplllleeeessss command. By default, sampling is set to 100 points. A
higher sampling rate will produce more accurate plots, but will
take longer. This parameter no longer has any effect on data-
file plotting.
Syntax:
set samples <expression>
show samples
_1_8._2_6. _S_i_z_e
The sssseeeetttt ssssiiiizzzzeeee command scales the displayed size of the plot. On
some terminals, changing the size of the plot will result in
text being misplaced. Increasing the size of the plot may pro-
duce strange results. Decreasing is safer.
Syntax:
set size {<xscale>,<yscale>}
show size
The <xscale> and <yscale> values are the scaling factors for
the size. The defaults (1,1) are selected if the scaling fac-
tors are omitted.
Examples:
To set the size to normal size use:
set size
To make the plot half size use:
set size 0.5,0.5
To make a landscape plot have a 1:1 aspect ratio in polar mode
use:
set size 0.721,1.0
To show the size use:
show size
For the LaTeX and Fig terminals the default size (scale factor
1,1) is 5 inches wide by 3 inches high. The big Fig terminal
(bbbbffffiiiigggg) is 7 inches wide by 5 inches high. The postscript
default is landscape mode 10 inches wide and 7 inches high.
Note that the size of the plot includes the space used by the
labels; the plotting area itself is smaller.
_1_8._2_7. _S_t_y_l_e
Plots may be displayed in one of six styles: lllliiiinnnneeeessss, ppppooooiiiinnnnttttssss,
May 21, 1992
GNUPLOT 3.2 35
lllliiiinnnneeeessssppppooooiiiinnnnttttssss, iiiimmmmppppuuuullllsssseeeessss, ddddoooottttssss, or eeeerrrrrrrroooorrrrbbbbaaaarrrrssss. The lllliiiinnnneeeessss style con-
nects adjacent points with lines. The ppppooooiiiinnnnttttssss style displays a
small symbol at each point. The lllliiiinnnneeeessssppppooooiiiinnnnttttssss style does both
lllliiiinnnneeeessss and ppppooooiiiinnnnttttssss. The iiiimmmmppppuuuullllsssseeeessss style displays a vertical line
from the x axis to each point. The ddddoooottttssss style plots a tiny dot
at each data point; this is useful for scatter plots with many
points.
The eeeerrrrrrrroooorrrrbbbbaaaarrrrssss style is relevant only for to data file ppppllllooootttts. It
is treated like ppppooooiiiinnnnttttssss for function ppppllllooootttts and ssssppppllllooootttts. For data
file ppppllllooootttts, eeeerrrrrrrroooorrrrbbbbaaaarrrrssss is like ppppooooiiiinnnnttttssss, 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 third and fourth columns, or as specified with the uuuussssiiiinnnngggg
option to plot. See ppppllllooootttt eeeerrrrrrrroooorrrrbbbbaaaarrrrssss for more information.
Default styles are chosen with the sssseeeetttt ffffuuuunnnnccccttttiiiioooonnnn ssssttttyyyylllleeee and sssseeeetttt
ddddaaaattttaaaa ssssttttyyyylllleeee commands. See ppppllllooootttt ssssttttyyyylllleeee for information about how
to override the default plotting style for individual func-
tions.
Syntax:
set function style <style>
set data style <style>
show function style
show data style
where <style> is lllliiiinnnneeeessss, ppppooooiiiinnnnttttssss, lllliiiinnnneeeessssppppooooiiiinnnnttttssss, iiiimmmmppppuuuullllsssseeeessss, ddddoooottttssss, or
eeeerrrrrrrroooorrrrbbbbaaaarrrrssss.
_1_8._2_8. _S_u_r_f_a_c_e
sssseeeetttt ssssuuuurrrrffffaaaacccceeee controls the display of surfaces. It is useful if
contours are to be displayed by themselves. Whenever sssseeeetttt nnnnoooossssuuuurrrr----
ffffaaaacccceeee is issued, no surface isolines/mesh will be drawn. See
also sssseeeetttt ccccoooonnnnttttoooouuuurrrr.
Syntax:
set surface
set nosurface
show surface
_1_8._2_9. _T_e_r_m_i_n_a_l
GNUPLOT supports many different graphics devices. Use the sssseeeetttt
tttteeeerrrrmmmmiiiinnnnaaaallll command to select the type of device for which GNUPLOT
May 21, 1992
GNUPLOT 3.2 36
will produce output.
Syntax:
set terminal {<terminal-type>}
show terminal
If <terminal-type> is omitted, GNUPLOT will list the available
terminal types. <terminal-type> may be abbreviated.
Use sssseeeetttt oooouuuuttttppppuuuutttt to redirect this output to a file or device.
Several terminals have additional options. For example, see
dddduuuummmmbbbb, iiiirrrriiiissss4444dddd, hhhhpppplllljjjjiiiiiiii or ppppoooossssttttssssccccrrrriiiipppptttt.
_1_8._2_9._1. _D_u_m_b
The dumb terminal driver has an optional size specifica-
tion.
Syntax:
set terminal dumb {<xsize> <ysize>}
where <xsize> and <ysize> set the size of the dumb termi-
nals. Default is 79 by 24.
Examples:
set term dumb
set term dumb 79 49 #(VGA screen - why would any-
one want to do that!?)
_1_8._2_9._2. _H_p_l_j_i_i
The HP LaserJet II and HP DeskJet drivers have a single
option.
Syntax:
set terminal hpljii {<resolution>}
set terminal hpdj {<resolution>}
where <resolution> is the resolution of the output in dots
per inch. It must be 77775555, 111100000000, 111155550000 or 333300000000.
Example:
set terminal hpljii 150
May 21, 1992
GNUPLOT 3.2 37
_1_8._2_9._3. _I_r_i_s_4_d
The iris4d driver can operate in two modes.
Syntax:
set terminal iris4d {24}
If the hardware supports only 8 bits, use the default sssseeeetttt
tttteeeerrrrmmmmiiiinnnnaaaallll iiiirrrriiiissss4444dddd. If, however, the hardware supports 24
bits (8 per red/green/blue), use sssseeeetttt tttteeeerrrrmmmmiiiinnnnaaaallll iiiirrrriiiissss4444dddd 22224444.
When using 24-bit mode, the colors can be directly speci-
fied via the file .gnuplot_iris4d that is searched in the
current directory and then in the home directory specified
by the HOME environment variable. This file holds RGB
values for the background, border, labels and nine plot-
ting colors, in that order. For example, here is a file
containing the default colors:
85 85 85 /* Back Ground */
0 0 0 /* Boundary */
170 0 170 /* Labeling */
85 255 255 /* Plot Color 1 */
170 0 0 /* Plot Color 2 */
0 170 0 /* Plot Color 3 */
255 85 255 /* Plot Color 4 */
255 255 85 /* Plot Color 5 */
255 85 85 /* Plot Color 6 */
85 255 85 /* Plot Color 7 */
0 170 170 /* Plot Color 8 */
170 170 0 /* Plot Color 9 */
This file has exactly 12 lines of RGB triples. No empty
lines are allowed and anything after the third number in
line is ignored.
_1_8._2_9._4. _P_b_m
Several options may be set in the PBMplus driver.
Syntax:
set terminal pbm {<fontsize>}
set terminal pgm {<fontsize>}
set terminal ppm {<fontsize>}
where <fontsize> is ssssmmmmaaaallllllll, mmmmeeeeddddiiiiuuuummmm, or llllaaaarrrrggggeeee. Default size
is 640 pixels wide and 480 pixels high. The pbm output is
a portable bitmap (one bit per pixel). The pgm output is
May 21, 1992
GNUPLOT 3.2 38
a portable graymap (three bits per pixel). The ppm
output is a portable pixmap (color, four bits per pixel).
The output of these drivers can be used with Jef
Poskanzer's excellent PBMPLUS package which provides pro-
grams to convert the above PBMPLUS formats to GIF, TIFF,
MacPaint, Macintosh PICT, PCX, X11 bitmap and many others.
Examples:
set term pbm small
set size 2,2
set term ppm medium
_1_8._2_9._5. _P_o_s_t_s_c_r_i_p_t
Several options may be set in the PostScript driver.
Syntax:
set terminal postscript {<mode>} {<color>}
{"<fontname>"}
{<fontsize>}
where <mode> is llllaaaannnnddddssssccccaaaappppeeee, ppppoooorrrrttttrrrraaaaiiiitttt, eeeeppppssss or ddddeeeeffffaaaauuuulllltttt.
Selecting default sets all options to their defaults.
<color> is either ccccoooolllloooorrrr or mmmmoooonnnnoooocccchhhhrrrroooommmmeeee. "<fontname>" is
the name of a valid PostScript font. <fontsize> is the
size of the font in PostScript points, before scaling by
the sssseeeetttt ssssiiiizzzzeeee command. Defaults are llllaaaannnnddddssssccccaaaappppeeee, mmmmoooonnnnoooocccchhhhrrrroooommmmeeee,
"Courier", and 14pt. Default size of PostScript plot is
landscape mode 10 inches wide and 7 inches high.
To get EPS output, use the eeeeppppssss mode and make only one plot
per file. In eeeeppppssss mode the whole plot is halved in size;
the fonts are half the given size, and the plot is 5
inches wide and 3.5 inches high.
Examples:
set term postscript default # old postscript
set term postscript landscape 22 # old psbig
set term postscript eps 14 # old epsf1
set term postscript eps 22 # old epsf2
set size 0.7,1.4
set term post portrait color "Times-Roman" 14
May 21, 1992
GNUPLOT 3.2 39
_1_8._2_9._6. _A_i_f_m
Several options may be set in the Adobe Illustrator 3.0
driver.
Syntax:
set terminal aifm {<color>}
{"<fontname>"}
{<fontsize>}
Selecting default sets all options to their defaults.
<color> is either ccccoooolllloooorrrr or mmmmoooonnnnoooocccchhhhrrrroooommmmeeee. "<fontname>" is
the name of a valid PostScript font. <fontsize> is the
size of the font in PostScript points, before scaling by
the sssseeeetttt ssssiiiizzzzeeee command. Defaults are mmmmoooonnnnoooocccchhhhrrrroooommmmeeee, "Courier",
and 14pt.
Also, since AI does not really support multiple pages,
multiple graphs will be output directly on one another.
However, each graph will be grouped individually, making
it easy to separate them inside AI (just pick them up and
move them).
Examples:
set term aifm
set term aifm 22
set size 0.7,1.4
set term aifm color "Times-Roman" 14
_1_8._2_9._7. _T_a_b_l_e
Instead of producing a picture, term type 'table' prints
out the evaluation results in a multicolumn ASCII table of
X Y Z values. For those times when you really want to see
the numbers, now you can see them on the screen or save to
a file.
_1_8._3_0. _T_i_c_s
By default, tics are drawn inwards from the border on all four
sides. The sssseeeetttt ttttiiiiccccssss command can be used to change the tics to
be drawn outwards on the left and bottom borders only. This is
useful when doing impulse plots.
May 21, 1992
GNUPLOT 3.2 40
Syntax:
set tics {<direction>}
show tics
where <direction> may be iiiinnnn or oooouuuutttt. sssseeeetttt ttttiiiiccccssss defaults to iiiinnnn.
See also the sssseeeetttt xxxxttttiiiiccccssss, sssseeeetttt yyyyttttiiiiccccssss, and sssseeeetttt zzzzttttiiiiccccssss command for
more control of tic marks. Using splot, in 3-d plots, one can
adjust the relative height of the vertical (Z) axis using sssseeeetttt
ttttiiiiccccsssslllleeeevvvveeeellll. The numeric argument provided specifies the location
of the bottom of the scale. a zero will put it on the bottom
grid and any positive number somewhere along the z axis.
Syntax:
set ticslevel {<level>}
show tics
where <level> is a non negative numeric argument. For example,
set ticslevel 0.5
sets the tics level to the default value.
See also the sssseeeetttt vvvviiiieeeewwww.
_1_8._3_1. _T_i_m_e
The optional sssseeeetttt ttttiiiimmmmeeee places the time and date of the plot
either at the top or bottom of the left margin. The exact loca-
tion is device dependent.
Syntax:
set time {<xoff>}{,<yoff>}
set notime
show time
Specifying constants <xoff> or <yoff> as optional offsets for
the time will move the time <xoff> or <yoff> character screen
coordinates. For example,
set time ,-3
will change only the y offset of the time, moving the title
down by roughly the height of three characters.
May 21, 1992
GNUPLOT 3.2 41
_1_8._3_2. _T_i_t_l_e
The sssseeeetttt ttttiiiittttlllleeee command produces a plot title that is centered at
the top of the plot. Using the optional x,y screen offsets, the
title can be placed anywhere on the plot. sssseeeetttt ttttiiiittttlllleeee with no
parameters clears the title.
Syntax:
set title {"<title-text>"} {<xoff>}{,<yoff>}
show title
Specifying constants <xoff> or <yoff> as optional offsets for
the title will move the title <xoff> or <yoff> character screen
coordinates. Note these are screen coordinates and not plot
coordinates. For example,
set title ,-1
will change only the y offset of the title, moving the title
down by roughly the height of one character.
(The Latex, EEPIC, and Imagen drivers allow \\ in a string to
specify a newline.)
_1_8._3_3. _T_r_a_n_g_e
The sssseeeetttt ttttrrrraaaannnnggggeeee command sets the parametric range used to com-
pute x and y values when in parametric mode. If not in
parametric mode (see sssseeeetttt ppppaaaarrrraaaammmmeeeettttrrrriiiicccc) then this range is not
used. This command does not affect x/y autoscaling or x/y
ranges.
This range may also be specified on the ppppllllooootttt command line when
in parametric mode.
Syntax:
set trange [{<tmin> : <tmax>}]
where <tmin> and <tmax> terms are constants or expressions.
Both the <tmin> and <tmax> terms are optional. Anything omitted
will not be changed, so
set trange [:10]
changes tmax to 10 without affecting tmin. See also sssseeeetttt uuuurrrraaaannnnggggeeee
and sssseeeetttt ppppaaaarrrraaaammmmeeeettttrrrriiiicccc.
May 21, 1992
GNUPLOT 3.2 42
_1_8._3_4. _U_r_a_n_g_e
The sssseeeetttt uuuurrrraaaannnnggggeeee and sssseeeetttt vvvvrrrraaaannnnggggeeee commands sets the parametric
ranges used to compute x, y, and z values when in ssssppppllllooootttt
parametric mode. If not in parametric mode (see sssseeeetttt ppppaaaarrrraaaammmmeeeettttrrrriiiicccc)
then these ranges are not used. This command does not affect
x/y autoscaling or x/y ranges.
This range may also be specified on the ssssppppllllooootttt command line when
in parametric mode. See ppppllllooootttt for more information
Syntax:
set urange [{<umin> : <umax>}]
where <umin> and <umax> terms are constants or expressions.
Both the <umin> and <umax> terms are optional. Anything omitted
will not be changed, so
set urange [:10]
changes umax to 10 without affecting umin. See also sssseeeetttt
ttttrrrraaaannnnggggeeee.
_1_8._3_5. _V_a_r_i_a_b_l_e_s
The sssshhhhoooowwww vvvvaaaarrrriiiiaaaabbbblllleeeessss command lists all user-defined variables and
their values.
Syntax:
show variables
_1_8._3_6. _V_i_e_w
The sssseeeetttt vvvviiiieeeewwww command sets the view point for ssssppppllllooootttts. This com-
mand controls the way the 3-d coordinates of the plot are
mapped into the 2-d screen space. This command provides con-
trols to both rotation and scaling of the plotted data but sup-
ports orthographic projections only.
Syntax:
set view <rot_x> {,{<rot_z>}{,{<scale>}{,<scale_z>}}}
show view
where <rot_x> and <rot_z> control the rotation angles (in
degrees) along a virtual 3-d coordinate system aligned with the
screen such that the screen horizontal axis is x, screen verti-
cal axis is y, and the axis perpendicular to the screen is z.
May 21, 1992
GNUPLOT 3.2 43
<rot_x> is bounded to the [0:180] range with a default of 60
degrees, while <rot_z> is bounded to the [0:360] range with a
default of 30 degrees. <scale> controls the scaling of the
entire ssssppppllllooootttt, while <scale_z> scales the z axis only. Both
scales default to 1.0.
Examples:
set view 60, 30, 1, 1
set view ,,0.5
The first sets all the four default values. The second changes
only scale, to 0.5.
See also sssseeeetttt ttttiiiiccccsssslllleeeevvvveeeellll.
_1_8._3_7. _V_r_a_n_g_e
The sssseeeetttt vvvvrrrraaaannnnggggeeee command is similar to the sssseeeetttt uuuurrrraaaannnnggggeeee command.
Please see sssseeeetttt uuuurrrraaaannnnggggeeee.
_1_8._3_8. _X_l_a_b_e_l
The sssseeeetttt xxxxllllaaaabbbbeeeellll command sets the x-axis label that is centered
along the x axis. Using the optional x,y screen offsets, the
label can be placed anywhere on the plot. sssseeeetttt xxxxllllaaaabbbbeeeellll with no
parameters clears the label.
Syntax:
set xlabel {"<label>"} {<xoff>}{,<yoff>}
show xlabel
Specifying constants <xoff> or <yoff> as optional offsets for
the label will move the label <xoff> or <yoff> character screen
coordinates. For example,
set xlabel -1
will change only the x offset of the xlabel, moving the label
roughly one character width to the left.
(The LaTeX, EEPIC, and Imagen drivers allow \\ in a string to
specify a newline.)
May 21, 1992
GNUPLOT 3.2 44
_1_8._3_9. _X_r_a_n_g_e
The sssseeeetttt xxxxrrrraaaannnnggggeeee command sets the horizontal range that will be
displayed. This command turns x axis autoscaling off.
This range may also be specified on the ppppllllooootttt command line.
Syntax:
set xrange [{<xmin> : <xmax>}]
where <xmin> and <xmax> terms are constants or expressions.
Both the <xmin> and <xmax> terms are optional. Anything omitted
will not be changed, so
set xrange [:10]
changes xmax to 10 without affecting xmin.
_1_8._4_0. _X_t_i_c_s
Fine control of the x axis tic marks is possible with the sssseeeetttt
xxxxttttiiiiccccssss command. The x-axis tic marks may be turned off with the
sssseeeetttt nnnnooooxxxxttttiiiiccccssss command. They may be turned on (the default state)
with sssseeeetttt xxxxttttiiiiccccssss.
Syntax:
set xtics { {<start>, <incr>{, <end>}} |
{({"<label>"} <pos> {, {"<label>"}
<pos>}...)} }
set noxtics
show xtics
The <start>, <incr>, <end> form specifies that a series of tics
will be plotted on the x axis between the x values <start> and
<end> with an increment of <incr>. If <end> is not given it is
assumed to be infinity. The increment may be negative. For
example,
set xtics 0,.5,10
makes tics at 0, 0.5, 1, 1.5, ..., 9.5, 10.
The ("<label>" <pos>, ...) form allows arbitrary tic positions
or non-numeric tic labels. A set of tics are a set of posi-
tions, each with its own optional label. Note that the label is
a string enclosed by quotes, and may be a constant string, such
as "hello", or contain formatting information for the tic
number (which is the same as the position), such as "%3f
clients". See sssseeeetttt ffffoooorrrrmmmmaaaatttt for more information about this case.
The label may even be empty. Examples:
set xtics ("low" 0, "medium" 50, "high" 100)
set xtics (1,2,4,8,16,32,64,128,256,512,1024)
May 21, 1992
GNUPLOT 3.2 45
set xtics ("bottom" 0, "" 10, "top" 20)
Tics will only be plotted when in range.
The sssseeeetttt yyyyttttiiiiccccssss and sssseeeetttt nnnnooooyyyyttttiiiiccccssss commands work identically. See
also the sssseeeetttt ffffoooorrrrmmmmaaaatttt command.
_1_8._4_1. _X_z_e_r_o_a_x_i_s
sssseeeetttt xxxxzzzzeeeerrrrooooaaaaxxxxiiiissss draws the x-axis. By default, this option is on.
sssseeeetttt nnnnooooxxxxzzzzeeeerrrrooooaaaaxxxxiiiissss causes GNUPLOT to omit the x-axis.
Syntax:
set xzeroaxis
set noxzeroaxis
show xzeroaxis
_1_8._4_2. _Y_l_a_b_e_l
The sssseeeetttt yyyyllllaaaabbbbeeeellll command sets the y-axis label. The position of
this label depends on the terminal, and can be one of the fol-
lowing three positions (the position can be adjusted with
optional parameters).
1. Horizontal text flushed left at the top left of the plot.
Terminals that cannot rotate text will probably use this
method.
2. Vertical text centered vertically at the left of the plot.
Terminals that can rotate text will probably use this method.
3. Horizontal text centered vertically at the left of the plot.
The LaTeX and EEPIC drivers use this method. The user must
insert line breaks using \\ to prevent the ylabel from
overwriting the plot. To produce a vertical row of characters,
add \\ between every printing character (but this is ugly).
Syntax:
set ylabel {"<label>"} {<xoff>}{,<yoff>}
show ylabel
With no parameters, the label is cleared. Specifying constants
<xoff> or <yoff> as optional offsets for the label will move
the label <xoff> or <yoff> character screen coordinates. For
example,
set ylabel -1
May 21, 1992
GNUPLOT 3.2 46
will change only the x offset of the ylabel, moving the label
roughly one character width left of its default position. This
is especially useful with the LaTeX driver.
(The LaTeX, EEPIC, and Imagen drivers allow \\ in a string to
specify a newline.)
_1_8._4_3. _Y_r_a_n_g_e
The sssseeeetttt yyyyrrrraaaannnnggggeeee command sets the vertical range that will be
displayed. This command turns y axis autoscaling off.
This range may also be specified on the ppppllllooootttt command line.
Syntax:
set yrange [{<ymin> : <ymax>}]
where <ymin> and <ymax> terms are constants or expressions.
Both the <ymin> and <ymax> terms are optional. Anything omitted
will not be changed, so
set yrange [:10]
changes ymax to 10 without affecting ymin.
_1_8._4_4. _Y_t_i_c_s
The sssseeeetttt yyyyttttiiiiccccssss and sssseeeetttt nnnnooooyyyyttttiiiiccccssss commands are similar to the sssseeeetttt
xxxxttttiiiiccccssss and sssseeeetttt nnnnooooxxxxttttiiiiccccssss commands. Please see sssseeeetttt xxxxttttiiiiccccssss.
_1_8._4_5. _Y_z_e_r_o_a_x_i_s
sssseeeetttt yyyyzzzzeeeerrrrooooaaaaxxxxiiiissss draws the y-axis. By default, this option is on.
sssseeeetttt nnnnooooyyyyzzzzeeeerrrrooooaaaaxxxxiiiissss causes GNUPLOT to omit the y-axis.
Syntax:
set yzeroaxis
set noyzeroaxis
show yzeroaxis
_1_8._4_6. _Z_e_r_o
May 21, 1992
GNUPLOT 3.2 47
The zzzzeeeerrrroooo value is the default threshold for values approaching
0.0. GNUPLOT will not plot a point if its imaginary part is
greater in magnitude than the zzzzeeeerrrroooo threshold. Axis ranges can-
not be less than zzzzeeeerrrroooo. The default zzzzeeeerrrroooo value is 1e-8. This can
be changed with the sssseeeetttt zzzzeeeerrrroooo command.
Syntax:
set zero <expression>
show zero
_1_8._4_7. _Z_e_r_o_a_x_i_s
sssseeeetttt zzzzeeeerrrrooooaaaaxxxxiiiissss draws the x-axis and y-axis. By default, this
option is on. sssseeeetttt nnnnoooozzzzeeeerrrrooooaaaaxxxxiiiissss causes GNUPLOT to omit the axes,
and is equivalent to sssseeeetttt nnnnooooxxxxzzzzeeeerrrrooooaaaaxxxxiiiissss;;;; sssseeeetttt nnnnooooyyyyzzzzeeeerrrrooooaaaaxxxxiiiissss....
Syntax:
set zeroaxis
set nozeroaxis
show zeroaxis
See sssseeeetttt xxxxzzzzeeeerrrrooooaaaaxxxxiiiissss and sssseeeetttt yyyyzzzzeeeerrrrooooaaaaxxxxiiiissss.
_1_8._4_8. _Z_l_a_b_e_l
The sssseeeetttt zzzzllllaaaabbbbeeeellll command sets the z-axis label that is centered
along the z axis. Using the optional x,y screen offsets, the
label can be placed anywhere on the plot. sssseeeetttt zzzzllllaaaabbbbeeeellll with no
parameters clears the label.
Syntax:
set zlabel {"<label>"} {<xoff>}{,<yoff>}
show zlabel
Specifying constants <xoff> or <yoff> as optional offsets for
the label will move the label <xoff> or <yoff> character screen
coordinates. For example,
set zlabel ,1
will change only the y offset of the zlabel, moving the label
roughly one character height up.
The zlabel will be drawn whenever surfaces or contours are
plotted, in the space above the grid level.
(The LaTeX, EEPIC, and Imagen drivers allow \\ in a string to
specify a newline.)
May 21, 1992
GNUPLOT 3.2 48
_1_8._4_9. _Z_r_a_n_g_e
The sssseeeetttt zzzzrrrraaaannnnggggeeee command sets the vertical range that will be
displayed. This command turns z axis autoscaling off. The
zrange is used only by ssssppppllllooootttt and is ignored by ppppllllooootttt.
This range may also be specified on the ssssppppllllooootttt command line.
Syntax:
set zrange [{<zmin> : <zmax>}]
where <zmin> and <zmax> terms are constants or expressions.
Both the <zmin> and <zmax> terms are optional. Anything omitted
will not be changed, so
set zrange [2:]
changes zmin to 2 without affecting zmax.
_1_8._5_0. _Z_t_i_c_s
The sssseeeetttt zzzzttttiiiiccccssss and sssseeeetttt nnnnoooozzzzttttiiiiccccssss commands are similar to the sssseeeetttt
xxxxttttiiiiccccssss and sssseeeetttt nnnnooooxxxxttttiiiiccccssss commands. Please see sssseeeetttt xxxxttttiiiiccccssss.
_1_9. _S_h_e_l_l
The sssshhhheeeellllllll command spawns an interactive shell. To return to GNUPLOT,
type llllooooggggoooouuuutttt if using VMS, eeeexxxxiiiitttt or the END-OF-FILE character if using
Unix, eeeennnnddddcccclllliiii if using AmigaDOS, or eeeexxxxiiiitttt if using MS-DOS.
A single shell command may be spawned by preceding it with the !
character ($ if using VMS) at the beginning of a command line. Con-
trol will return immediately to GNUPLOT after this command is exe-
cuted. For example, in VMS, AmigaDOS, or MS-DOS,
! dir
prints a directory listing and then returns to GNUPLOT.
_2_0. _S_p_l_o_t
Three-dimensional surface and contour plotting is available in GNU-
PLOT with the ssssppppllllooootttt command. See the ppppllllooootttt command for features com-
mon to the ppppllllooootttt command.
May 21, 1992
GNUPLOT 3.2 49
See also sssseeeetttt ccccoooonnnnttttoooouuuurrrr, sssseeeetttt ccccnnnnttttrrrrppppaaaarrrraaaammmm, and sssseeeetttt ssssuuuurrrrffffaaaacccceeee.
_2_1. _S_t_a_r_t-_u_p
When GNUPLOT is run, it looks for an initialization file to load.
This file is called ....ggggnnnnuuuuppppllllooootttt on Unix and AmigaDOS systems, and
GGGGNNNNUUUUPPPPLLLLOOOOTTTT....IIIINNNNIIII on other systems. If this file is not found in the
current directory, the program will look for it in the home direc-
tory (under AmigaDOS and MS-DOS, the environment variable GNUPLOT
should contain the name of this directory).
If this file is found, GNUPLOT executes the commands in this file.
This is most useful for setting the terminal type and defining any
functions or variables that are used often.
_2_2. _S_u_b_s_t_i_t_u_t_i_o_n
Command-line substitution is specified by a system command enclosed
in backquotes. This command is spawned and the output it produces
replaces the name of the command (and backquotes) on the command
line.
Newlines in the output produced by the spawned command are replaced
with blanks.
Command-line substitution can be used anywhere on the GNUPLOT com-
mand line.
Example:
This will run the program lllleeeeaaaassssttttssssqqqq and replace lllleeeeaaaassssttttssssqqqq (including
backquotes) on the command line with its output:
f(x) = `leastsq`
or, in VMS
f(x) = `run leastsq`
_2_3. _U_s_e_r-_d_e_f_i_n_e_d
New user-defined variables and functions of one or two variables may