next up previous contents index
Next: Gprintf Up: Set-show Previous: Fontpath   Contents   Index


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 {axis}tics format commands.

Syntax:

     set format {<axes>} {"<format-string>"}
     set format {<axes>} {'<format-string>'}
     show format

where 4#4axes5#5 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 (2#2n) and enhanced text markup is accepted in the format string. Use double-quotes rather than single-quotes in this case. See also syntax (p. [*]). 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. [*]) for more information about tic labels, and set decimalsign (p. [*]) for how to use non-default decimal separators in numbers printed this way. See also

http://www.gnuplot.info/demo/electron.htmlelectron demo (electron.dem).



Subsections
next up previous contents index
Next: Gprintf Up: Set-show Previous: Fontpath   Contents   Index
2013-02-05