Credits Overview Plotting Styles Commands Terminals

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. For information on using an explicit format for input data see using format.

Syntax:

      set format {<axes>} {"<format-string>"} {numeric|timedate|geographic}
      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 "% h", "$%h$" for LaTeX terminals. Other formats such as "%.2f" or "%3.0em" are often desirable. "set format" with no following string will restore 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 (\n) and enhanced text markup is accepted in the format string. Use double-quotes rather than single-quotes in this case. See also syntax. 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 for more information about tic labels, and set decimalsign for how to use non-default decimal separators in numbers printed this way. See also electron demo (electron.dem).

Subtopics