Credits | Overview | Plotting Styles | Commands | Terminals |
---|
The set xlabel command sets the x axis label. Similar commands set labels on the other axes.
Syntax:
set xlabel {"<label>"} {offset <offset>} {font "<font>{,<size>}"} {textcolor <colorspec>} {{no}enhanced} {rotate by <degrees> | rotate parallel | norotate} show xlabel
The same syntax applies to x2label, ylabel, y2label, zlabel and cblabel.
If <offset> is specified by either x,y or x,y,z the label is moved by the given offset. It may be preceded by first, second, graph, screen, or character to select the coordinate system. See coordinates for details. By default, the character coordinate system is used. For example, "set xlabel offset -1,0" will change only the x offset of the title, moving the label roughly one character width to the left. The size of a character depends on both the font and the terminal.
<font> is used to specify the font in which the label is written; the units of the font <size> depend upon which terminal is used.
noenhanced requests that the label text not be processed by the enhanced text mode parser, even if enhanced text mode is currently active.
To clear a label, put no options on the command line, e.g., "set y2label".
The default positions of the axis labels are as follows:
xlabel: The x-axis label is centered below the bottom of the plot.
ylabel: The y-axis label is centered to the left of the plot, defaulting to either horizontal or vertical orientation depending on the terminal type. The program may not reserve enough space to the left of the plot to hold long non-rotated ylabel text. You can adjust this with set lmargin.
zlabel: The z-axis label is centered along the z axis and placed in the space above the grid level.
cblabel: The color box axis label is centered along the box and placed below or to the right according to horizontal or vertical color box gradient.
y2label: The y2-axis label is placed to the right of the y2 axis. The position is terminal-dependent in the same manner as is the y-axis label.
x2label: The x2-axis label is placed above the plot but below the title. It is also possible to create an x2-axis label by using new-line characters to make a multi-line plot title, e.g.,
set title "This is the title\n\nThis is the x2label"
Note that double quotes must be used. The same font will be used for both lines, of course.
The orientation (rotation angle) of the x, x2, y and y2 axis labels in 2D plots can be changed by specifying rotate by <degrees>. The orientation of the x and y axis labels in 3D plots defaults to horizontal but can be changed to run parallel to the axis by specifying rotate parallel.
If you are not satisfied with the default position of an axis label, use set label instead--that command gives you much more control over where text is placed.
Please see syntax for further information about backslash processing and the difference between single- and double-quoted strings.