Credits | Overview | Plotting Styles | Commands | Terminals |
---|
Arbitrary labels can be placed on the plot using the set label command.
Syntax:
set label {<tag>} {"<label text>"} {at <position>} {left | center | right} {norotate | rotate {by <degrees>}} {font "<name>{,<size>}"} {noenhanced} {front | back} {textcolor <colorspec>} {point <pointstyle> | nopoint} {offset <offset>} {nobox} {boxed {bs <boxstyle>}} {hypertext} unset label {<tag>} show label
The <position> is specified by either x,y or x,y,z, and may be preceded by first, second, polar, graph, screen, or character to indicate the coordinate system. See coordinates for details.
The tag is an integer that is used to identify the label. If no <tag> is given, the lowest unused tag value is assigned automatically. The tag can be used to delete or modify a specific label. To change any attribute of an existing label, use the set label command with the appropriate tag, and specify the parts of the label to be changed.
The <label text> can be a string constant, a string variable, or a string- valued expression. See strings, sprintf, and gprintf.
By default, the text is placed flush left against the point x,y,z. To adjust the way the label is positioned with respect to the point x,y,z, add the justification parameter, which may be left, right or center, indicating that the point is to be at the left, right or center of the text. Labels outside the plotted boundaries are permitted but may interfere with axis labels or other text.
Some terminals support enclosing the label in a box. See set style textbox. Not all terminals can handle boxes for rotated text.
If rotate is given, the label is written vertically. If rotate by <degrees> is given, the baseline of the text will be set to the specified angle. Some terminals do not support text rotation.
Font and its size can be chosen explicitly by font "<name>{,<size>}" if the terminal supports font settings. Otherwise the default font of the terminal will be used.
Normally the enhanced text mode string interpretation, if enabled for the current terminal, is applied to all text strings including label text. The noenhanced property can be used to exempt a specific label from the enhanced text mode processing. The can be useful if the label contains underscores, for example. See enhanced text.
If front is given, the label is written on top of the graphed data. If back is given (the default), the label is written underneath the graphed data. Using front will prevent a label from being obscured by dense data.
textcolor <colorspec> changes the color of the label text. <colorspec> can be a linetype, an rgb color, or a palette mapping. See help for colorspec and palette. textcolor may be abbreviated tc.
`tc default` resets the text color to its default state. `tc lt <n>` sets the text color to that of line type <n>. `tc ls <n>` sets the text color to that of line style <n>. `tc palette z` selects a palette color corresponding to the label z position. `tc palette cb <val>` selects a color corresponding to <val> on the colorbox. `tc palette fraction <val>`, with 0<=val<=1, selects a color corresponding to the mapping [0:1] to grays/colors of the `palette`. `tc rgb "#RRGGBB"` or `tc rgb "0xRRGGBB"` sets an arbitrary 24-bit RGB color. `tc rgb 0xRRGGBB` As above; a hexadecimal constant does not require quotes.
If a <pointstyle> is given, using keywords lt, pt and ps, see style, a point with the given style and color of the given line type is plotted at the label position and the text of the label is displaced slightly. This option is used by default for placing labels in mouse enhanced terminals. Use nopoint to turn off the drawing of a point near the label (this is the default).
The displacement defaults to 1,1 in pointsize units if a <pointstyle> is given, 0,0 if no <pointstyle> is given. The displacement can be controlled by the optional offset <offset> where <offset> is specified by either x,y or x,y,z, and may be preceded by first, second, graph, screen, or character to select the coordinate system. See coordinates for details.
If one (or more) axis is timeseries, the appropriate coordinate should be given as a quoted time string according to the timefmt format string. See set xdata and set timefmt.
The options available for set label are also available for the labels plot style. See labels. In this case the properties textcolor, rotate, and pointsize may be followed by keyword variable rather than by a fixed value. In this case the corresponding property of individual labels is determined by additional columns in the using specifier.
Subtopics | ||
---|---|---|