
- •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
gnuplot 4.6 |
145 |
The meaning of a negative value for <r> is di erent. If <r>=-1, gnuplot tries to set the scales so that the unit has the same length on both the x and y axes. This is equivalent to set view equal xy. See set view equal (p. 156). If <r>=-2, the unit on y has twice the length of the unit on x, and so on.
The success of gnuplot in producing the requested aspect ratio depends on the terminal selected. The graph area will be the largest rectangle of aspect ratio <r> that will t into the speci ed portion of the output (leaving adequate margins, of course).
square is a synonym for ratio 1.
Both noratio and nosquare return the graph to the default aspect ratio of the terminal, but do not return <xscale> or <yscale> to their default values (1.0).
ratio and square have no e ect on 3D plots, but do a ect 3D projections created using set view map. See also set view equal (p. 156), which forces the x and y axes of a 3D onto the same scale.
Examples:
To set the size so that the plot lls the available canvas:
set size 1,1
To make the graph half size and square use:
set size square 0.5,0.5
To make the graph twice as high as wide use:
set size ratio 2
Style
Default plotting styles are chosen with the set style data and set style function commands. See plot with (p. 90) for information about how to override the default plotting style for individual functions and data sets. See plotting styles (p. 42) for a complete list of styles.
Syntax:
set style function <style> set style data <style> show style function
show style data
Default styles for speci c plotting elements may also be set.
Syntax:
set style arrow <n> <arrowstyle> set style fill <fillstyle>
set style histogram <histogram style options> set style line <n> <linestyle>
If gnuplot was built with the support of objects, then the following options are also available:
Syntax:
set style rectangle <object options> <linestyle> <fillstyle> set style circle radius <size>
set style ellipse size <size> units {xy|xx|yy}
Set style arrow
Each terminal has a default set of arrow and point types, which can be seen by using the command test. set style arrow de nes a set of arrow types and widths and point types and sizes so that you can refer to them later by an index instead of repeating all the information at each invocation.
Syntax:

146 |
gnuplot 4.6 |
set style arrow <index> default
set style arrow <index> {nohead | head | heads}
{size <length>,<angle>{,<backangle>}} {filled | empty | nofilled}
{front | back}
{{linestyle | ls <line_style>} | {linetype | lt <line_type>}
{linewidth | lw <line_width} }
unset style arrow show style arrow
<index> is an integer that identi es the arrowstyle.
If default is given all arrow style parameters are set to their default values.
If the linestyle <index> already exists, only the given parameters are changed while all others are preserved. If not, all unde ned values are set to the default values.
Specifying nohead produces arrows drawn without a head | a line segment. This gives you yet another way to draw a line segment on the plot. By default, arrows have one head. Specifying heads draws arrow heads on both ends of the line.
Head size can be controlled by size <length>,<angle> or size <length>,<angle>,<backangle>, where
<length> de nes length of each branch of the arrow head and <angle> the angle (in degrees) they make with the arrow. <Length> is in x-axis units; this can be changed by rst, second, graph, screen, or character before the <length>; see coordinates (p. 22) for details. <Backangle> only takes e ect whenlled or empty is also used. Then, <backangle> is the angle (in degrees) the back branches make with the arrow (in the same direction as <angle>). The g terminal has a restricted backangle function. It supports three di erent angles. There are two thresholds: Below 70 degrees, the arrow head gets an indented back angle. Above 110 degrees, the arrow head has an acute back angle. Between these thresholds, the back line is straight.
Specifying lled produces lled arrow heads (if heads are used). Filling is supported on lled-polygon capable terminals, see help of pm3d (p. 134) for their list, otherwise the arrow heads are closed but notlled. The same result (closed but not lled arrow head) is reached by specifying empty. Further, lling and outline is obviously not supported on terminals drawing arrows by their own speci c routines, like metafont, metapost, latex or tgif.
The line style may be selected from a user-de ned list of line styles (see set style line (p. 149)) or may be de ned here by providing values for <line type> (an index from the default list of styles) and/or <line width> (which is a multiplier for the default width).
Note, however, that if a user-de ned line style has been selected, its properties (type and width) cannot be altered merely by issuing another set style arrow command with the appropriate index and lt or lw.
If front is given, the arrows are written on top of the graphed data. If back is given (the default), the arrow is written underneath the graphed data. Using front will prevent a arrow from being obscured by dense data.
Examples:
To draw an arrow without an arrow head and double width, use:
set style arrow 1 nohead lw 2 set arrow arrowstyle 1
See also set arrow (p. 96) for further examples.
Boxplot
The set style boxplot command allows you to change the layout of plots created using the boxplot plot style.
Syntax:
set style boxplot {range <r> | fraction <f>}
gnuplot 4.6 |
147 |
{{no}outliers} {pointtype <p>} {candlesticks | financebars} {separation <x>}
{labels off | auto | x | x2} {sorted | unsorted}
The box in the boxplot always spans the range of values from the rst quartile to the third quartile of the data points. The limit of the whiskers that extend from the box can be controlled in two di erent ways. By default the whiskers extend from each end of the box for a range equal to 1.5 times the interquartile range (i.e. the vertical height of the box proper). Each whisker is truncated back toward the median so that it terminates at a y value belonging to some point in the data set. Since there may be no point whose value is exactly 1.5 times the interquartile distance, the whisker may be shorter than its nominal range. This default corresponds to
set style boxplot range 1.5
Alternatively, you can specify the fraction of the total number of points that the whiskers should span. In this case the range is extended symmetrically from the median value until it encompasses the requested fraction of the data set. Here again each whisker is constrained to end at a point in the data set. To span 95% of the points in the set
set style boxplot fraction 0.95
Any points that lie outside the range of the whiskers are considered outliers. By default these are drawn as individual circles (pointtype 7). The option nooutliers disables this.
By default boxplots are drawn in a style similar to candlesticks, but you have the option of using instead a style similar to nance bars.
If the using speci cation for a boxplot contains a fourth column, the values in that column will be interpreted as the discrete leveles of a factor variable. In this case more than one boxplots may be drawn, as many as the number of levels of the factor variable. These boxplots will be drawn next to each other, the distance between them is 1.0 by default (in x-axis units). This distance can be changed by the option separation.
The labels option governs how and where these boxplots (each representing a part of the dataset) are labeled. By default the value of the factor is put as a tick label on the horizontal axis { x or x2, depending on which one is used for the plot itself. This setting corresponds to option labels auto. The labels can be forced to use either of the x or x2 axes { options labels x and labels x2, respectively {, or they can be turned o altogether with the option labels o .
By default the boxplots corresponding to di erent levels of the factor variable are not sorted; they will be drawn in the same order the levels are encountered in the data le. This behavior corresponds to the unsorted option. If the sorted option is active, the levels are rst sorted alphabetically, and the boxplots are drawn in the sorted order.
The separation, labels, sorted and unsorted option only have an e ect if a fourth column is given the plot speci cation.
See boxplot (p. 44), candlesticks (p. 45), nancebars (p. 49).
Set style data
The set style data command changes the default plotting style for data plots.
Syntax:
set style data <plotting-style> show style data
See plotting styles (p. 42) for the choices. If no choice is given, the choices are listed. show style data shows the current default data plotting style.
Set style ll
The set style ll command is used to set the default style of the plot elements in plots with boxes, histograms, candlesticks and lledcurves. This default can be superseded by llstyles attached to individual