5.23.19 label

set label <label number> '<text>' [<co-ordinate>] <x>,
                                  [<co-ordinate>] <y>
                                  [rotate <angle>]
<co-ordinate> = ( first | second | screen | graph |
                  axis<axisnumber>                  )

The set label command can be used to place text labels onto a plot. For example:

set label 1 'Hello' 0, 0

would place the word ‘Hello’ at plot co-ordinates (0,0), as measured on the $x$- and $y$-axes. The tag ‘1’ immediately following the ‘label’ keyword is an identification number, and allows the label to be removed later with the unset label command. By default the position coordinates of the label are measured relative to the first $x$- and $y$-axes, but can be specified in a range of coordinate systems. These are specified as follows:

set label 1 'Hello' first 0, second 0

As can be seen, the name of the desired coordinate system precedes the position value in that coordinate system. Following gnuplot’s nomenclature, the coordinate system first the default, measures the graph using the $x$- and $y$-axes. second uses the $x2$- and $y2$-axes. screen and graph both measure in centimetres from the origin of the graph. The syntax axisn may also be used, to use the $n$ th $x$- or $y$-axis; for example, axis3:

set label 1 'Hello' axis3 1, axis4 1

A rotation angle may optionally be specified after the keyword ‘rotate’ to produce text rotated to any arbitrary angle, measured in degrees counter-clockwise. The following example would produce upward-running text:

set label 1 'Hello' 1.2, 2.5 rotate 90