4.6 Module graph.key: Keys

The following class provides a key, whose instances can be passed to the constructor keyword argument key of a graph. The class is implemented in graph.key.

class key( dist=0.2*unit.v_cm, pos="tr", hpos=None, vpos=None, hinside=1, vinside=1, hdist=0.6*unit.v_cm, vdist=0.4*unit.v_cm, symbolwidth=0.5*unit.v_cm, symbolheight=0.25*unit.v_cm, symbolspace=0.2*unit.v_cm, textattrs=[], columns=1, columndist=0.5*unit.v_cm, border=0.3*unit.v_cm, keyattrs=None)
This class writes the title of the data in a plot together with a small illustration of the style. The style is responsible for its illustration.

dist is a visual length and a distance between the key entries. pos is the position of the key with respect to the graph. Allowed values are combinations of "t" (top), "m" (middle) and "b" (bottom) with "l" (left), "c" (center) and "r" (right). Alternatively, you may use hpos and vpos to specify the relative position using the range [0:1]. hdist and vdist are the distances from the specified corner of the graph. hinside and vinside are numbers to be set to 0 or 1 to define whether the key should be placed horizontally and vertically inside of the graph or not.

symbolwidth and symbolheight are passed to the style to control the size of the style illustration. symbolspace is the space between the illustration and the text. textattrs are attributes for the text creation. They are merged with [text.vshift.mathaxis].

columns is a number of columns of the graph key and columndist is the distance between those columns.

When keyattrs is set to contain some draw attributes, the graph key is enlarged by border and the key area is drawn using keyattrs.