Text labels may be placed on plots using the set label command. As with all textual labels in PyXPlot, these are rendered in LaTeX:
set label 1 'Hello World' at 0,0
As in the previous section, the number ‘1’ is a reference number, which allows the label to be removed by either of the following two commands:
set nolabel 1 unset label 1
The positional coordinates for the text label, placed after the keyword ‘at’, can be specified in any of the coordinate systems described for arrows above. A rotation angle may optionally be specified after the keyword ‘rotate’, to rotate text counter-clockwise by a given angle, measured in degrees. For example, the following would produce upward-running text:
set label 1 'Hello World' at axis3 3.0, axis4 2.7 rotate 90
The fontsize of these text labels can globally be set using the set fontsize x command. This applies not only to the set label command, but also to plot titles, axis labels, keys, etc. The value given should be an integer in the range . The default is zero, which corresponds to LaTeX’s normalsize;
corresponds to tiny and 5 to Huge.
The set textcolour command can be used to globally set the colour of all text output, and applies to all of the text that the set fontsize command does. It is especially useful when producing plots to be embedded in presentation slideshows, where bright text on a dark background may be desired. It should be followed either by an integer, to set a colour from the present palette, or by a colour name. A list of the recognised colour names can be found in Section 4.6. For example:
set textcolour 2 set textcolour blue
By default, each label’s specified position corresponds to its bottom left corner. This alignment may be changed with the set texthalign and set textvalign commands. The former takes the options left, centre or right, and the latter takes the options bottom, centre or top, for example:
set texthalign right set textvalign top