14.10.2014 Views

gnuplot documentation

gnuplot documentation

gnuplot documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

70 SET-SHOW <strong>gnuplot</strong> 4.3 107<br />

Justification of the plot titles within the key is controlled by Left or Right (default). The text and<br />

sample can be reversed (reverse) and a box can be drawn around the key (box {...}) in a specified<br />

linetype and linewidth, or a user-defined linestyle.<br />

By default the first plot label is at the top of the key and successive labels are entered below it. The<br />

invert option causes the first label to be placed at the bottom of the key, with successive labels entered<br />

above it. This option is useful to force the vertical ordering of labels in the key to match the order of<br />

box types in a stacked histogram.<br />

The is a number of character heights to be added to or subtracted from the height<br />

of the key box. This is useful mainly when you are putting a box around the key and want larger borders<br />

around the key entries.<br />

All plotted curves of plots and splots are titled according to the default option autotitles. The<br />

automatic generation of titles can be suppressed by noautotitles; then only those titles explicitly<br />

defined by (s)plot ... title ... will be drawn.<br />

The set key autotitle columnheader command causes the first entry in each column of input data<br />

to be interpreted as a text string and used as a title for the corresponding plot. If the quantity being<br />

plotted is a function of data from several columns, <strong>gnuplot</strong> may be confused as to which column to draw<br />

the title from. In this case it is necessary to specify the column explicitly in the plot command, e.g.<br />

plot "datafile" using (($2+$3)/$4) title 3 with lines.<br />

An overall title can be put on the key (title "") — see also syntax (p. 38) for the distinction<br />

between text in single- or double-quotes. The key title uses the same justification as do the plot titles.<br />

The defaults for set key are on, right, top, vertical, Right, noreverse, noinvert, samplen 4,<br />

spacing 1.25, title "", and nobox. The default is the same as that used for the plot<br />

borders. Entering set key default returns the key to its default configuration.<br />

The key is drawn as a sequence of lines, with one plot described on each line. On the right-hand side<br />

(or the left-hand side, if reverse is selected) of each line is a representation that attempts to mimic the<br />

way the curve is plotted. On the other side of each line is the text description (the line title), obtained<br />

from the plot command. The lines are vertically arranged so that an imaginary straight line divides the<br />

left- and right-hand sides of the key. It is the coordinates of the top of this line that are specified with<br />

the set key command. In a plot, only the x and y coordinates are used to specify the line position. For<br />

a splot, x, y and z are all used as a 3D location mapped using the same mapping as the graph itself to<br />

form the required 2D screen position of the imaginary line.<br />

When using the TeX or PostScript drivers, or similar drivers where formatting information is embedded<br />

in the string, <strong>gnuplot</strong> is unable to calculate correctly the width of the string for key positioning. If<br />

the key is to be positioned at the left, it may be convenient to use the combination set key left Left<br />

reverse. The box and gap in the grid will be the width of the literal string.<br />

If splot is being used to draw contours, the contour labels will be listed in the key. If the alignment of<br />

these labels is poor or a different number of decimal places is desired, the label format can be specified.<br />

See set clabel (p. 91) for details.<br />

Examples:<br />

This places the key at the default location:<br />

set key default<br />

This disables the key:<br />

unset key<br />

This places a key at coordinates 2,3.5,2 in the default (first) coordinate system:<br />

set key at 2,3.5,2<br />

This places the key below the graph:<br />

set key below<br />

This places the key in the bottom left corner, left-justifies the text, gives it a title, and draws a box<br />

around it in linetype 3:<br />

set key left bottom Left title ’Legend’ box 3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!