
- •Copyright
- •Introduction
- •Seeking-assistance
- •New features
- •New syntax
- •Local customization of linetypes
- •New plot styles
- •Revised polar axes
- •New smoothing algorithms
- •New time/date handling
- •Statistical summary of data
- •New or revised terminal drivers
- •Backwards compatibility
- •Batch/Interactive Operation
- •Canvas size
- •Command-line-editing
- •Comments
- •Coordinates
- •Datastrings
- •Enhanced text mode
- •Environment
- •Expressions
- •Functions
- •Elliptic integrals
- •Random number generator
- •Value
- •Operators
- •Unary
- •Binary
- •Ternary
- •Summation
- •Fonts
- •Cairo (pdfcairo, pngcairo, epscairo, wxt terminals)
- •Gd (png, gif, jpeg terminals)
- •Postscript (also encapsulated postscript *.eps)
- •Glossary
- •Linetypes, colors, and styles
- •Colorspec
- •Linecolor variable
- •Rgbcolor variable
- •Linestyles vs linetypes
- •Mouse input
- •Bind
- •Bind space
- •Mouse variables
- •Plotting
- •Start-up (initialization)
- •String constants and string variables
- •Substitution and Command line macros
- •Substitution of system commands in backquotes
- •Substitution of string variables as macros
- •String variables, macros, and command line substitution
- •Syntax
- •Quote Marks
- •Time/Date data
- •Boxerrorbars
- •Boxes
- •Boxplot
- •Boxxyerrorbars
- •Candlesticks
- •Circles
- •Ellipses
- •Dots
- •Filledcurves
- •Financebars
- •Fsteps
- •Fillsteps
- •Histeps
- •Histograms
- •Newhistogram
- •Automated iteration over multiple columns
- •Image
- •Transparency
- •Image failsafe
- •Impulses
- •Labels
- •Lines
- •Linespoints
- •Points
- •Polar
- •Steps
- •Rgbalpha
- •Rgbimage
- •Vectors
- •Xerrorbars
- •Xyerrorbars
- •Yerrorbars
- •Xerrorlines
- •Xyerrorlines
- •Yerrorlines
- •3D (surface) plots
- •2D projection (set view map)
- •Call
- •Clear
- •Evaluate
- •Exit
- •Adjustable parameters
- •Short introduction
- •Error estimates
- •Statistical overview
- •Practical guidelines
- •Control
- •Control variables
- •Environment variables
- •Multi-branch
- •Starting values
- •Tips
- •Help
- •History
- •Iteration
- •Load
- •Lower
- •Pause
- •Plot
- •Axes
- •Binary
- •General
- •Array
- •Record
- •Skip
- •Format
- •Endian
- •Filetype
- •Keywords
- •Data
- •Every
- •Index
- •Smooth
- •Thru
- •Using
- •Volatile
- •Errorbars
- •Errorlines
- •Functions
- •Parametric
- •Ranges
- •Iteration
- •Title
- •With
- •Quit
- •Raise
- •Refresh
- •Replot
- •Reread
- •Reset
- •Save
- •Set-show
- •Angles
- •Arrow
- •Autoscale
- •Parametric mode
- •Polar mode
- •Bars
- •Bind
- •Bmargin
- •Border
- •Boxwidth
- •Clabel
- •Clip
- •Cntrparam
- •Color box
- •Colornames
- •Contour
- •Data style
- •Decimalsign
- •Dgrid3d
- •Dummy
- •Encoding
- •Fontpath
- •Format
- •Gprintf
- •Function style
- •Functions
- •Grid
- •Hidden3d
- •Historysize
- •Isosamples
- •Key placement
- •Key samples
- •Label
- •Linetype
- •Lmargin
- •Loadpath
- •Locale
- •Logscale
- •Macros
- •Mapping
- •Margin
- •Mouse
- •Doubleclick
- •Mouseformat
- •Scrolling
- •X11 mouse
- •Zoom
- •Multiplot
- •Mx2tics
- •Mxtics
- •My2tics
- •Mytics
- •Mztics
- •Object
- •Rectangle
- •Ellipse
- •Circle
- •Polygon
- •Origin
- •Output
- •Parametric
- •Plot
- •Algorithm
- •Position
- •Scanorder
- •Clipping
- •Hidden3d
- •Interpolate
- •Palette
- •Rgbformulae
- •Functions
- •Cubehelix
- •File
- •Gamma correction
- •Postscript
- •Pointintervalbox
- •Pointsize
- •Polar
- •Psdir
- •Raxis
- •Rmargin
- •Rrange
- •Rtics
- •Samples
- •Size
- •Style
- •Set style arrow
- •Boxplot
- •Set style data
- •Set style function
- •Set style increment
- •Set style line
- •Set style circle
- •Set style rectangle
- •Set style ellipse
- •Surface
- •Table
- •Terminal
- •Termoption
- •Tics
- •Ticslevel
- •Ticscale
- •Timestamp
- •Timefmt
- •Title
- •Tmargin
- •Trange
- •Urange
- •Variables
- •Version
- •View
- •Vrange
- •X2data
- •X2dtics
- •X2label
- •X2mtics
- •X2range
- •X2tics
- •X2zeroaxis
- •Xdata
- •Xdtics
- •Xlabel
- •Xmtics
- •Xrange
- •Xtics
- •Xtics rangelimited
- •Xyplane
- •Xzeroaxis
- •Y2data
- •Y2dtics
- •Y2label
- •Y2mtics
- •Y2range
- •Y2tics
- •Y2zeroaxis
- •Ydata
- •Ydtics
- •Ylabel
- •Ymtics
- •Yrange
- •Ytics
- •Yzeroaxis
- •Zdata
- •Zdtics
- •Zzeroaxis
- •Cbdata
- •Cbdtics
- •Zero
- •Zeroaxis
- •Zlabel
- •Zmtics
- •Zrange
- •Ztics
- •Cblabel
- •Cbmtics
- •Cbrange
- •Cbtics
- •Shell
- •Splot
- •Matrix
- •Grid data
- •Splot surfaces
- •Stats (Statistical Summary)
- •System
- •Test
- •Unset
- •Update
- •While
- •Complete list of terminals
- •Aifm
- •Aqua
- •Cairolatex
- •Canvas
- •Cgm font
- •Cgm fontsize
- •Cgm linewidth
- •Cgm rotate
- •Cgm solid
- •Cgm size
- •Cgm width
- •Cgm nofontlist
- •Context
- •Requirements
- •Calling gnuplot from ConTeXt
- •Corel
- •Debug
- •Dumb
- •Eepic
- •Emxvga
- •Epscairo
- •Epslatex
- •Excl
- •Examples
- •Gpic
- •Grass
- •Hpgl
- •Hpljii
- •Hppj
- •Imagen
- •Jpeg
- •Latex
- •Linux
- •Lua tikz
- •Macintosh
- •METAFONT Instructions
- •Metapost Instructions
- •Next
- •Openstep (next)
- •Pdfcairo
- •Examples
- •Pngcairo
- •Postscript
- •Editing postscript
- •Postscript prologue
- •Postscript adobeglyphnames
- •Pslatex and pstex
- •Pstricks
- •Regis
- •Svga
- •Texdraw
- •Tgif
- •Tikz
- •Tkcanvas
- •Tpic
- •Vgagl
- •Windows
- •Graph-menu
- •Printing
- •Text-menu
- •Wgnuplot.mnu
- •Wgnuplot.ini
- •Xlib
- •Known limitations
- •External libraries

104 |
gnuplot 4.6 |
set cntrparam levels incremental 100,50
See also set contour (p. 105) for control of where the contours are drawn, and set clabel (p. 101) for control of the format of the contour labels and linetypes.
See also
contours demo (contours.dem)
and
contours with user defined levels demo (discrete.dem).
Color box
The color scheme, i.e. the gradient of the smooth color with min z and max z values of pm3d's palette, is drawn in a color box unless unset colorbox.
set colorbox set colorbox {
{vertical | horizontal }
{default | user }
{origin x, y }
{size x, y }
{front | back }
{noborder | bdefault | border [line style] }
}
show colorbox unset colorbox
Color box position can be default or user. If the latter is speci ed the values as given with the origin and size subcommands are used. The box can be drawn after (front) or before (back) the graph or the surface.
The orientation of the color gradient can be switched by options vertical and horizontal.
origin x, y and size x, y are used only in combination with the user option. The x and y values are interpreted as screen coordinates by default, and this is the only legal option for 3D plots. 2D plots, including splot with set view map, allow any coordinate system to be speci ed. Try for example:
set colorbox horiz user origin .1,.02 size .8,.04
which will draw a horizontal gradient somewhere at the bottom of the graph.
border turns the border on (this is the default). noborder turns the border o . If an positive integer argument is given after border, it is used as a line style tag which is used for drawing the border, e.g.:
set style line 2604 linetype -1 linewidth .4 set colorbox border 2604
will use line style 2604, a thin line with the default border color (-1) for drawing the border. bdefault (which is the default) will use the default border line style for drawing the border of the color box.
The axis of the color box is called cb and it is controlled by means of the usual axes commands, i.e. set/unset/show with cbrange, [m]cbtics, format cb, grid [m]cb, cblabel, and perhaps even cbdata, [no]cbdtics, [no]cbmtics.
set colorbox without any parameter switches the position to default. unset colorbox resets the default parameters for the colorbox and switches the colorbox o .
See also help for set pm3d (p. 134), set palette (p. 137), x11 pm3d (p. 230), and set style line (p. 149).
Colornames
Gnuplot knows a limited number of color names. You can use these to de ne the color range spanned by a pm3d palette, or to assign a terminal-independent color to a particular linetype or linestyle. To see the list of known color names, use the command show colornames (p. 104). Example:

gnuplot 4.6 |
105 |
set style line 1 linecolor rgb "sea-green"
Contour
set contour enables contour drawing for surfaces. This option is available for splot only. It requires grid data, see grid data (p. 170) for more details. If contours are desired from non-grid data, set dgrid3d can be used to create an appropriate grid.
Syntax:
set contour {base | surface | both} unset contour
show contour
The three options specify where to draw the contours: base draws the contours on the grid base where the x/ytics are placed, surface draws the contours on the surfaces themselves, and both draws the contours on both the base and the surface. If no option is provided, the default is base.
See also set cntrparam (p. 102) for the parameters that a ect the drawing of contours, and set clabel (p. 101) for control of labelling of the contours.
The surface can be switched o (see set surface (p. 151)), giving a contour-only graph. Though it is possible to use set size to enlarge the plot to ll the screen, more control over the output format can be obtained by writing the contour information to a le, and rereading it as a 2D data le plot:
unset surface set contour
set cntrparam ...
set table 'filename' splot ...
unset table
# contour info now in filename set term <whatever>
plot 'filename'
In order to draw contours, the data should be organized as "grid data". In such a le all the points for a single y-isoline are listed, then all the points for the next y-isoline, and so on. A single blank line (a line containing no characters other than blank spaces and a carriage return and/or a line feed) separates one y-isoline from the next. See also splot data le (p. 168).
See also
contours demo (contours.dem)
and
contours with user defined levels demo (discrete.dem).
Data style
This form of the command is deprecated. Please see set style data (p. 147).
Data le
The set data le command options control interpretation of elds read from input data les by the plot, splot, and t commands. Six such options are currently implemented.
Set data le fortran
The set data le fortran command enables a special check for values in the input le expressed as Fortran D or Q constants. This extra check slows down the input process, and should only be selected if you do

106 |
gnuplot 4.6 |
in fact have data les containing Fortran D or Q constants. The option can be disabled again using unset data le fortran.
Set data le nofpe trap
The set data le nofpe trap command tells gnuplot not to re-initialize a oating point exception handler before every expression evaluation used while reading data from an input le. This can signi cantly speed data input from very large les at the risk of program termination if a oating-point exception is generated.
Set data le missing
The set data le missing command allows you to tell gnuplot what character string is used in a data le to denote missing data. Exactly how this missing value will be treated depends on the using speci er of the plot or splot command.
Syntax:
set datafile missing {"<string>"} show datafile missing
unset datafile
Example:
# Ignore entries containing IEEE NaN ("Not a Number") code set datafile missing "NaN"
Example:
set style data linespoints plot '-'
1 10
2 20
3 ?
4 40
5 50 e
set datafile missing "?" plot '-'
1 10
2 20
3 ?
4 40
5 50 e
plot '-' using 1:2 1 10 2 20 3 ?
4 40
5 50 e
plot '-' using 1:($2) 1 10 2 20 3 ?
4 40
5 50 e
gnuplot 4.6 |
107 |
The rst plot will recognize only the rst datum in the "3 ?" line. It will use the single-datum-on-a-line convention that the line number is "x" and the datum is "y", so the point will be plotted (in this case erroneously) at (2,3).
The second and third plot commands will correctly ignore the middle line. The plotted line will connect the points at (2,20) and (4,40).
The fourth plot will also correctly ignore the middle line, but the plotted line will not connect the points at (2,20) and (4,40).
There is no default character for missing, but in many cases any non-parsible string of characters found where a numerical value is expected will be treated as missing data.
Set data le separator
The command set data le separator "<char>" tells gnuplot that data elds in subsequent input les are separated by <char> rather than by whitespace. The most common use is to read in csv (comma-separated value) les written by spreadsheet or database programs. By default data elds are separated by whitespace.
Syntax:
set datafile separator {"<char>" | whitespace}
Examples:
#Input file contains tab-separated fields set datafile separator "\t"
#Input file contains comma-separated values fields set datafile separator ","
Set data le commentschars
The set data le commentschars command allows you to tell gnuplot what characters are used in a datale to denote comments. Gnuplot will ignore rest of the line behind the speci ed characters if either of them is the rst non-blank character on the line.
Syntax:
set datafile commentschars {"<string>"} show datafile commentschars
unset commentschars
Default value of the string is "#!" on VMS and "#" otherwise.
Then, the following line in a data le is completely ignored
# 1 2 3 4
but the following
1 # 3 4
produces rather unexpected plot unless
set datafile missing '#'
is speci ed as well.
Example:
set datafile commentschars "#!%"