
- •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

92 |
gnuplot 4.6 |
plot 'exper.dat' w lines, 'exper.dat' notitle w errorbars
Another way to plot "exper.dat" with errorlines (errorbars require three or four columns): plot 'exper.dat' w errorlines
This plots sin(x) and cos(x) with linespoints, using the same line type but di erent point types: plot sin(x) with linesp lt 1 pt 3, cos(x) with linesp lt 1 pt 4
This plots le "data" with points of type 3 and twice usual size: plot 'data' with points pointtype 3 pointsize 2
This plots le "data" with variable pointsize read from column 4
plot 'data' using 1:2:4 with points pt 5 pointsize variable
This plots two data sets with lines di ering only by weight:
plot 'd1' t "good" w l lt 2 lw 3, 'd2' t "bad" w l lt 2 lw 1
This plots lled curve of x*x and a color stripe:
plot x*x with filledcurve closed, 40 with filledcurve y1=10
This plots x*x and a color box:
plot x*x, (x>=-5 && x<=5 ? 40 : 1/0) with filledcurve y1=10 lt 8
This plots a surface with color lines: splot x*x-y*y with line palette
This plots two color surfaces at di erent altitudes:
splot x*x-y*y with pm3d, x*x+y*y with pm3d at t
The print command prints the value of <expression> to the screen. It is synonymous with pause 0. <expression> may be anything that gnuplot can evaluate that produces a number, or it can be a string.
Syntax:
print <expression> {, <expression>, ...}
See expressions (p. 25). The output le can be set with set print.
Pwd
The pwd command prints the name of the working directory to the screen.
Note that if you wish to store the current directory into a string variable or use it in string expressions, then you can use variable GPVAL PWD, see show variables all (p. 155).
Quit
The exit and quit commands and END-OF-FILE character will exit gnuplot. Each of these commands will clear the output device (as does the clear command) before exiting.
gnuplot 4.6 |
93 |
Raise
Syntax:
raise {plot_window_nb}
The raise command raises (opposite to lower) plot window(s) associated with the interactive terminal of your gnuplot session, i.e. pm, win, wxt or x11. It puts the plot window to front (top) in the z-order windows stack of the window manager of your desktop.
As x11 and wxt support multiple plot windows, then by default they raise these windows in descending order of most recently created on top to the least recently created on bottom. If a plot number is supplied as an optional parameter, only the associated plot window will be raised if it exists.
The optional parameter is ignored for single plot-windows terminal, i.e. pm and win.
If the window is not raised under X11, then perhaps the plot window is running in a di erent X11 session (telnet or ssh session, for example), or perhaps raising is blocked by your window manager policy setting.
Refresh
The refresh command is similar to replot, with two major di erences. refresh reformats and redraws the current plot using the data already read in. This means that you can use refresh for plots with in-line data (pseudo-device '-') and for plots from data les whose contents are volatile. You cannot use the refresh command to add new data to an existing plot.
Mousing operations, in particular zoom and unzoom, will use refresh rather than replot if appropriate. Example:
plot 'datafile' volatile with lines, '-' with labels 100 200 "Special point"
e
# Various mousing operations go here set title "Zoomed in view"
set term post
set output 'zoom.ps' refresh
Replot
The replot command without arguments repeats the last plot or splot command. This can be useful for viewing a plot with di erent set options, or when generating the same plot for several devices.
Arguments speci ed after a replot command will be added onto the last plot or splot command (with an implied ',' separator) before it is repeated. replot accepts the same arguments as the plot and splot commands except that ranges cannot be speci ed. Thus you can use replot to plot a function against the second axes if the previous command was plot but not if it was splot.
N.B. | use of
plot '-' ; ... ; replot
is not recommended, because it will require that you type in the data all over again. In most cases you can use the refresh command instead, which will redraw the plot using the data previously read in.
Note that replot does not work in multiplot mode, since it reproduces only the last plot rather than the entire screen.
See also command-line-editing (p. 21) for ways to edit the last plot (p. 72) (splot (p. 167)) command.
See also show plot (p. 133) to show the whole current plotting command, and the possibility to copy it into the history (p. 69).

94 |
gnuplot 4.6 |
Reread
The reread command causes the current gnuplot command le, as speci ed by a load command or on the command line, to be reset to its starting point before further commands are read from it. This essentially implements an endless loop of the commands from the beginning of the command le to the reread command. (But this is not necessarily a disaster | reread can be very useful when used in conjunction with if.) The reread command has no e ect if input from standard input.
Examples:
Suppose the le "looper" contains the commands
a=a+1
plot sin(x*a) pause -1 if(a<5) reread
and from within gnuplot you submit the commands
a=0
load 'looper'
The result will be ve plots (separated by the pause message).
Suppose the le "data" contains six columns of numbers with a total yrange from 0 to 10; the rst is x and the next are ve di erent functions of x. Suppose also that the le "plotter" contains the commands
c_p = c_p+1
plot "$0" using 1:c_p with lines linetype c_p if(c_p < n_p) reread
and from within gnuplot you submit the commands
n_p=6 c_p=1 unset key
set yrange [0:10] set multiplot
call 'plotter' 'data' unset multiplot
The result is a single graph consisting of ve plots. The yrange must be set explicitly to guarantee that theve separate graphs (drawn on top of each other in multiplot mode) will have exactly the same axes. The linetype must be speci ed; otherwise all the plots would be drawn with the same type. See animate.dem in demo directory for an animated example.
Reset
The reset command causes all graph-related options that can be set with the set command to take on their default values. This command is useful, e.g., to restore the default graph settings at the end of a commandle, or to return to a de ned state after lots of settings have been changed within a command le. Please refer to the set command to see the default values that the various options take.
The following are not a ected by reset.
`set term` `set output` `set loadpath` `set fontpath` `set linetype` `set encoding` `set decimalsign` `set locale` `set psdir`
reset errors clears only the error state variables GPVAL ERRNO and GPVAL ERRMSG.
reset bind restores all hotkey bindings to their default state.