
- •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 |
39 |
There are three binary operators that require string operands: the string concatenation operator ".", the string equality operator "eq" and the string inequality operator "ne". The following example will print TRUE.
if ("A"."B" eq "AB") print "TRUE"
See also the two string formatting functions gprintf (p. 112) and sprintf (p. 27).
Substrings can be speci ed by appending a range speci er to any string, string variable, or string-valued function. The range speci er has the form [begin:end], where begin is the index of the rst character of the substring and end is the index of the last character of the substring. The rst character has index 1. The begin or end elds may be empty, or contain '*', to indicate the true start or end of the original string. E.g. str[:] and str[*:*] both describe the full string str.
Substitution and Command line macros
When a command line to gnuplot is rst read, i.e. before it is interpreted or executed, two forms of lexical substitution are performed. These are triggered by the presence of text in backquotes (ascii character 96) or preceded by @ (ascii character 64).
Substitution of system commands in backquotes
Command-line substitution is speci ed by a system command enclosed in backquotes. This command is spawned and the output it produces replaces the backquoted text on the command line. Some implementations also support pipes; see plot data le speciallenames (p. 81).
Command-line substitution can be used anywhere on the gnuplot command line, except inside strings delimited by single quotes.
Example:
This will run the program leastsq and replace leastsq (including backquotes) on the command line with its output:
f(x) = `leastsq`
or, in VMS
f(x) = `run leastsq`
These will generate labels with the current time and userid:
set label "generated on `date +%Y-%m-%d` by `whoami`" at 1,1 set timestamp "generated on %Y-%m-%d by `whoami`"
Substitution of string variables as macros
Substitution of command line macros is disabled by default, but may be enabled using the set macros command. If macro substitution is enabled, the character @ is used to trigger substitution of the current value of a string variable into the command line. The text in the string variable may contain any number of lexical elements. This allows string variables to be used as command line macros. Only string constants may be expanded using this mechanism, not string-valued expressions. For example:
set macros
style1 = "lines lt 4 lw 2" style2 = "points lt 3 pt 5 ps 2" range1 = "using 1:3"
range2 = "using 1:5"
plot "foo" @range1 with @style1, "bar" @range2 with @style2
The line containing @ symbols is expanded on input, so that by the time it is executed the e ect is identical to having typed in full