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.

Syntax:

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

where 5#5axes6#6 is either x, y, xy, x2, y2, z, cb or nothing (which refers to all axes at once). The length of the string representing a tic mark (after formatting with 'printf') is restricted to 100 characters. If the format string is omitted, the format will be returned to the default "% g". For LaTeX users, the format "$%g$" is often desirable. If the empty string "" is used, no label will be plotted with each tic, though the tic mark will still be plotted. To eliminate all tic marks, use unset xtics or unset ytics.

Newline (3#3n) is accepted in the format string. Use double-quotes rather than single-quotes to enable such interpretation. See also syntax (p. [*]).

The default format for both axes is "% g", but other formats such as "%.2f" or "%3.0em" are often desirable. Anything accepted by 'printf' when given a double precision number, and accepted by the terminal, will work. Some other options have been added. If the format string looks like a floating point format, then gnuplot tries to construct a reasonable format.

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
Ethan Merritt 2007-03-03