next up previous contents index
Next: Lines Up: Set style rectangle Previous: Impulses   Contents   Index


Labels

The labels style is available only if gnuplot is built with configuration option -enable-datastrings. For a 2-D plot with labels you must specify 3 input data columns; the text string found in the third column is printed at the X and Y coordinates generated by the first two column specifiers. The font, color, rotation angle and other properties of the printed text may be specified as additional command options (see set label (p. [*])). The example below will generate a 2-D plot with text labels taken from column 4 of the input file (tc lt 2 is shorthand for textcolor linetype 2, which is green).


 plot 'datafile' using 1:(0.5 * $2):4 with labels font "arial,11" tc lt 2

The labels style can also be used in 3-D plots. In this case four input column specifiers are required, corresponding to X Y Z and text.


 splot 'datafile' using 1:2:3:4 with labels

See also datastrings (p. [*]), set style data (p. [*]).


Ethan Merritt 2007-03-03