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

112 |
gnuplot 4.6 |
Syntax:
set fontpath {"pathlist1" {"pathlist2"...}} show fontpath
Path names may be entered as single directory names, or as a list of path names separated by a platformspeci c path separator, eg. colon (':') on Unix, semicolon (';') on DOS/Windows/OS/2 platforms. The show fontpath, save and save set commands replace the platform-speci c separator with a space character (' ') for maximum portability. If a directory name ends with an exclamation mark ('!') also the subdirectories of this directory are searched for font les.
If the environmental variable GNUPLOT FONTPATH is set, its contents are appended to fontpath. If it is not set, a system dependent default value is used. It is set by testing several directories for existence when using the fontpath the rst time. Thus, the rst call of set fontpath, show fontpath, save fontpath, plot, or splot with embedded font les takes a little more time. If you want to save this time you may set the environmental variable GNUPLOT FONTPATH since probing is switched o , then. You can nd out which is the default fontpath by using show fontpath.
show fontpath prints the contents of the user-de ned fontpath and the system fontpath separately. However, the save and save set commands save only the user-speci ed parts of fontpath.
For terminal drivers that access fonts by lename via the gd library, the font search path is controlled by the environmental variable GDFONTPATH.
Format
The format of the tic-mark labels can be set with the set format command or with the set tics format or individual set faxisgtics format commands.
Syntax:
set format {<axes>} {"<format-string>"} set format {<axes>} {'<format-string>'} show format
where <axes> is either x, y, xy, x2, y2, z, cb or nothing (which applies the format to all axes). The following two commands are equivalent:
set format y "%.2f" set ytics format "%.2f"
The length of the string is restricted to 100 characters. The default format is "% g", but other formats such as "%.2f" or "%3.0em" are often desirable. The format "$%g$" is often desirable for LaTeX. If no format string is given, the format will be returned to the default. If the empty string "" is given, tics will have no labels, although the tic mark will still be plotted. To eliminate the tic marks, use unset xtics or set tics scale 0.
Newline (nn) and enhanced text markup is accepted in the format string. Use double-quotes rather than single-quotes in this case. See also syntax (p. 40). Characters not preceded by "%" are printed verbatim. Thus you can include spaces and labels in your format string, such as "%g m", which will put " m" after each number. If you want "%" itself, double it: "%g %%".
See also set xtics (p. 160) for more information about tic labels, and set decimalsign (p. 108) for how to use non-default decimal separators in numbers printed this way. See also
electron demo (electron.dem).
Gprintf
The string function gprintf("format",x) uses gnuplot's own format speci ers, as do the gnuplot commands set format, set timestamp, and others. These format speci ers are not the same as those used by the standard C-language routine sprintf(). gprintf() accepts only a single variable to be formatted. Gnuplot also provides an sprintf("format",x1,x2,...) routine if you prefer. For a list of gnuplot's format options, see format speci ers (p. 113).
gnuplot 4.6 |
113 |
Format speci ers
The acceptable formats (if not in time/date mode) are:
|
Tic-mark label numerical format speci ers |
|
|
Format |
Explanation |
%f |
oating point notation |
%e or %E |
exponential notation; an "e" or "E" before the power |
%g or %G |
the shorter of %e (or %E) and %f |
%x or %X |
hex |
%o or %O |
octal |
%t |
mantissa to base 10 |
%l |
mantissa to base of current logscale |
%s |
mantissa to base of current logscale; scienti c power |
%T |
power to base 10 |
%L |
power to base of current logscale |
%S |
scienti c power |
%c |
character replacement for scienti c power |
%b |
mantissa of ISO/IEC 80000 notation (ki, Mi, Gi, Ti, Pi, Ei, Zi, Yi) |
%B |
pre x of ISO/IEC 80000 notation (ki, Mi, Gi, Ti, Pi, Ei, Zi, Yi) |
%P |
multiple of pi |
|
|
A 'scienti c' power is one such that the exponent is a multiple of three. Character replacement of scienti c powers ("%c") has been implemented for powers in the range -18 to +18. For numbers outside of this range the format reverts to exponential.
Other acceptable modi ers (which come after the "%" but before the format speci er) are "-", which leftjusti es the number; "+", which forces all numbers to be explicitly signed; " " (a space), which makes positive numbers have a space in front of them where negative numbers have "-"; "#", which places a decimal point after oats that have only zeroes following the decimal point; a positive integer, which de nes the eld width; "0" (the digit, not the letter) immediately preceding the eld width, which indicates that leading zeroes are to be used instead of leading blanks; and a decimal point followed by a non-negative integer, which de nes the precision (the minimum number of digits of an integer, or the number of digits following the decimal point of a oat).
Some systems may not support all of these modi ers but may also support others; in case of doubt, check the appropriate documentation and then experiment.
Examples: |
|
set format y "%t"; set ytics (5,10) |
# "5.0" and "1.0" |
set format y "%s"; set ytics (500,1000) |
# "500" and "1.0" |
set format y "%+-12.3f"; set ytics(12345) |
# "+12345.000 " |
set format y "%.2t*10^%+03T"; set ytic(12345)# "1.23*10^+04" |
|
set format y "%s*10^{%S}"; set ytic(12345) |
# "12.345*10^{3}" |
set format y "%s %cg"; set ytic(12345) |
# "12.345 kg" |
set format y "%.0P pi"; set ytic(6.283185) |
# "2 pi" |
set format y "%.0f%%"; set ytic(50) |
# "50%" |
set log y 2; set format y '%l'; set ytics (1,2,3) #displays "1.0", "1.0" and "1.5" (since 3 is 1.5 * 2^1)
There are some problem cases that arise when numbers like 9.999 are printed with a format that requires both rounding and a power.
If the data type for the axis is time/date, the format string must contain valid codes for the 'strftime' function (outside of gnuplot, type "man strftime"). See set timefmt (p. 154) for a list of the allowed input format codes.
Time/date speci ers
In time/date mode, the acceptable formats are: