357 lines (295 with data), 26.1 kB
@header@
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="matplotlib.html"><font color="#ffffff">matplotlib</font></a>.legend</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/jdhunter/dev/lib64/python2.5/site-packages/matplotlib/legend.py">/home/jdhunter/dev/lib64/python2.5/site-packages/matplotlib/legend.py</a></font></td></tr></table>
<p><tt>Place a legend on the axes at location loc. Labels are a<br>
sequence of strings and loc can be a string or an integer<br>
specifying the legend location<br>
<br>
The location codes are<br>
<br>
'best' : 0, (only implemented for axis legends)<br>
'upper right' : 1,<br>
'upper left' : 2,<br>
'lower left' : 3,<br>
'lower right' : 4,<br>
'right' : 5,<br>
'center left' : 6,<br>
'center right' : 7,<br>
'lower center' : 8,<br>
'upper center' : 9,<br>
'center' : 10,<br>
<br>
Return value is a sequence of text, line instances that make<br>
up the legend</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="numpy.html">numpy</a><br>
</td><td width="25%" valign=top><a href="warnings.html">warnings</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="matplotlib.artist.html#Artist">matplotlib.artist.Artist</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="matplotlib.legend.html#Legend">Legend</a>
</font></dt></dl>
</dd>
</dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="Legend">class <strong>Legend</strong></a>(<a href="matplotlib.artist.html#Artist">matplotlib.artist.Artist</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Place a legend on the axes at location loc. Labels are a<br>
sequence of strings and loc can be a string or an integer<br>
specifying the legend location<br>
<br>
The location codes are<br>
<br>
'best' : 0, (only implemented for axis legends)<br>
'upper right' : 1,<br>
'upper left' : 2,<br>
'lower left' : 3,<br>
'lower right' : 4,<br>
'right' : 5,<br>
'center left' : 6,<br>
'center right' : 7,<br>
'lower center' : 8,<br>
'upper center' : 9,<br>
'center' : 10,<br>
<br>
Return value is a sequence of text, line instances that make<br>
up the legend<br> </tt></td></tr>
<tr><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="matplotlib.legend.html#Legend">Legend</a></dd>
<dd><a href="matplotlib.artist.html#Artist">matplotlib.artist.Artist</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="Legend-__init__"><strong>__init__</strong></a>(self, parent, handles, labels, loc<font color="#909090">=None</font>, numpoints<font color="#909090">=None</font>, prop<font color="#909090">=None</font>, pad<font color="#909090">=None</font>, markerscale<font color="#909090">=None</font>, labelsep<font color="#909090">=None</font>, handlelen<font color="#909090">=None</font>, handletextsep<font color="#909090">=None</font>, axespad<font color="#909090">=None</font>, shadow<font color="#909090">=None</font>)</dt><dd><tt> parent # the artist that contains the legend<br>
handles # a list of artists (lines, patches) to add to the legend<br>
labels # a list of strings to label the legend<br>
loc # a location code<br>
numpoints = 4 # the number of points in the legend line<br>
prop = FontProperties(size='smaller') # the font property<br>
pad = 0.2 # the fractional whitespace inside the legend border<br>
markerscale = 0.6 # the relative size of legend markers vs. original<br>
shadow # if True, draw a shadow behind legend<br>
<br>
The following dimensions are in axes coords<br>
labelsep = 0.005 # the vertical space between the legend entries<br>
handlelen = 0.05 # the length of the legend lines<br>
handletextsep = 0.02 # the space between the legend line and legend text<br>
axespad = 0.02 # the border between the axes and legend edge</tt></dd></dl>
<dl><dt><a name="Legend-__str__"><strong>__str__</strong></a>(self)</dt></dl>
<dl><dt><a name="Legend-draw"><strong>draw</strong></a>(self, renderer)</dt></dl>
<dl><dt><a name="Legend-draw_frame"><strong>draw_frame</strong></a>(self, b)</dt><dd><tt>b is a boolean. Set draw frame to b</tt></dd></dl>
<dl><dt><a name="Legend-get_children"><strong>get_children</strong></a>(self)</dt></dl>
<dl><dt><a name="Legend-get_frame"><strong>get_frame</strong></a>(self)</dt><dd><tt>return the Rectangle instance used to frame the legend</tt></dd></dl>
<dl><dt><a name="Legend-get_lines"><strong>get_lines</strong></a>(self)</dt><dd><tt>return a list of lines.Line2D instances in the legend</tt></dd></dl>
<dl><dt><a name="Legend-get_patches"><strong>get_patches</strong></a>(self)</dt><dd><tt>return a list of patch instances in the legend</tt></dd></dl>
<dl><dt><a name="Legend-get_texts"><strong>get_texts</strong></a>(self)</dt><dd><tt>return a list of text.Text instance in the legend</tt></dd></dl>
<dl><dt><a name="Legend-get_window_extent"><strong>get_window_extent</strong></a>(self)</dt></dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>codes</strong> = {'best': 0, 'center': 10, 'center left': 6, 'center right': 7, 'lower center': 8, 'lower left': 3, 'lower right': 4, 'right': 5, 'upper center': 9, 'upper left': 2, ...}</dl>
<dl><dt><strong>zorder</strong> = 5</dl>
<hr>
Methods inherited from <a href="matplotlib.artist.html#Artist">matplotlib.artist.Artist</a>:<br>
<dl><dt><a name="Legend-add_callback"><strong>add_callback</strong></a>(self, func)</dt></dl>
<dl><dt><a name="Legend-contains"><strong>contains</strong></a>(self, mouseevent)</dt><dd><tt>Test whether the artist contains the mouse event.<br>
<br>
Returns the truth value and a dictionary of artist specific details of<br>
selection, such as which points are contained in the pick radius. See<br>
individual artists for details.</tt></dd></dl>
<dl><dt><a name="Legend-convert_xunits"><strong>convert_xunits</strong></a>(self, x)</dt><dd><tt>for artists in an axes, if the xaxis as units support,<br>
convert *x* using xaxis unit type</tt></dd></dl>
<dl><dt><a name="Legend-convert_yunits"><strong>convert_yunits</strong></a>(self, y)</dt><dd><tt>for artists in an axes, if the yaxis as units support,<br>
convert *y* using yaxis unit type</tt></dd></dl>
<dl><dt><a name="Legend-findobj"><strong>findobj</strong></a>(self, match<font color="#909090">=None</font>)</dt><dd><tt>pyplot signature:<br>
<a href="#Legend-findobj">findobj</a>(o=gcf(), match=None) <br>
<br>
recursively find all :class:matplotlib.artist.<a href="matplotlib.artist.html#Artist">Artist</a> instances<br>
contained in self<br>
<br>
*match* can be<br>
<br>
- None: return all objects contained in artist (including artist)<br>
<br>
- function with signature ``boolean = match(artist)`` used to filter matches<br>
<br>
- class instance: eg Line2D. Only return artists of class type<br>
<br>
.. plot:: ../mpl_examples/pylab_examples/findobj_demo.py</tt></dd></dl>
<dl><dt><a name="Legend-get_alpha"><strong>get_alpha</strong></a>(self)</dt><dd><tt>Return the alpha value used for blending - not supported on all<br>
backends</tt></dd></dl>
<dl><dt><a name="Legend-get_animated"><strong>get_animated</strong></a>(self)</dt><dd><tt>return the artist's animated state</tt></dd></dl>
<dl><dt><a name="Legend-get_axes"><strong>get_axes</strong></a>(self)</dt><dd><tt>return the axes instance the artist resides in, or *None*</tt></dd></dl>
<dl><dt><a name="Legend-get_clip_box"><strong>get_clip_box</strong></a>(self)</dt><dd><tt>Return artist clipbox</tt></dd></dl>
<dl><dt><a name="Legend-get_clip_on"><strong>get_clip_on</strong></a>(self)</dt><dd><tt>Return whether artist uses clipping</tt></dd></dl>
<dl><dt><a name="Legend-get_clip_path"><strong>get_clip_path</strong></a>(self)</dt><dd><tt>Return artist clip path</tt></dd></dl>
<dl><dt><a name="Legend-get_contains"><strong>get_contains</strong></a>(self)</dt><dd><tt>return the _contains test used by the artist, or *None* for default.</tt></dd></dl>
<dl><dt><a name="Legend-get_figure"><strong>get_figure</strong></a>(self)</dt><dd><tt>Return the :class:`~matplotlib.figure.Figure` instance the<br>
artist belongs to.</tt></dd></dl>
<dl><dt><a name="Legend-get_label"><strong>get_label</strong></a>(self)</dt></dl>
<dl><dt><a name="Legend-get_picker"><strong>get_picker</strong></a>(self)</dt><dd><tt>return the Pickeration instance used by this artist</tt></dd></dl>
<dl><dt><a name="Legend-get_transform"><strong>get_transform</strong></a>(self)</dt><dd><tt>Return the :class:`~matplotlib.transforms.Transform`<br>
instance used by this artist.</tt></dd></dl>
<dl><dt><a name="Legend-get_transformed_clip_path_and_affine"><strong>get_transformed_clip_path_and_affine</strong></a>(self)</dt><dd><tt>Return the clip path with the non-affine part of its<br>
transformation applied, and the remaining affine part of its<br>
transformation.</tt></dd></dl>
<dl><dt><a name="Legend-get_visible"><strong>get_visible</strong></a>(self)</dt><dd><tt>return the artist's visiblity</tt></dd></dl>
<dl><dt><a name="Legend-get_zorder"><strong>get_zorder</strong></a>(self)</dt></dl>
<dl><dt><a name="Legend-have_units"><strong>have_units</strong></a>(self)</dt><dd><tt>return *True* if units are set on the x or y axes</tt></dd></dl>
<dl><dt><a name="Legend-hitlist"><strong>hitlist</strong></a>(self, event)</dt><dd><tt>List the children of the artist which contain the mouse event</tt></dd></dl>
<dl><dt><a name="Legend-is_figure_set"><strong>is_figure_set</strong></a>(self)</dt></dl>
<dl><dt><a name="Legend-is_transform_set"><strong>is_transform_set</strong></a>(self)</dt><dd><tt><a href="matplotlib.artist.html#Artist">Artist</a> has transform explicity let</tt></dd></dl>
<dl><dt><a name="Legend-pchanged"><strong>pchanged</strong></a>(self)</dt><dd><tt>fire event when property changed</tt></dd></dl>
<dl><dt><a name="Legend-pick"><strong>pick</strong></a>(self, mouseevent)</dt><dd><tt>call signature::<br>
<br>
<a href="#Legend-pick">pick</a>(mouseevent)<br>
<br>
each child artist will fire a pick event if *mouseevent* is over<br>
the artist and the artist has picker set</tt></dd></dl>
<dl><dt><a name="Legend-pickable"><strong>pickable</strong></a>(self)</dt><dd><tt>return *True* if self is pickable</tt></dd></dl>
<dl><dt><a name="Legend-remove"><strong>remove</strong></a>(self)</dt><dd><tt>Remove the artist from the figure if possible. The effect<br>
will not be visible until the figure is redrawn, e.g., with<br>
:meth:`matplotlib.axes.Axes.draw_idle`. Call<br>
:meth:`matplotlib.axes.Axes.relim` to update the axes limits<br>
if desired.<br>
<br>
Note: :meth:`~matplotlib.axes.Axes.relim` will not see<br>
collections even if the collection was added to axes with<br>
*autolim* = True.<br>
<br>
Note: there is no support for removing the artist's legend entry.</tt></dd></dl>
<dl><dt><a name="Legend-remove_callback"><strong>remove_callback</strong></a>(self, oid)</dt></dl>
<dl><dt><a name="Legend-set"><strong>set</strong></a>(self, **kwargs)</dt><dd><tt>A tkstyle set command, pass *kwargs* to set properties</tt></dd></dl>
<dl><dt><a name="Legend-set_alpha"><strong>set_alpha</strong></a>(self, alpha)</dt><dd><tt>Set the alpha value used for blending - not supported on<br>
all backends<br>
<br>
ACCEPTS: float</tt></dd></dl>
<dl><dt><a name="Legend-set_animated"><strong>set_animated</strong></a>(self, b)</dt><dd><tt>set the artist's animation state<br>
<br>
ACCEPTS: [True | False]</tt></dd></dl>
<dl><dt><a name="Legend-set_axes"><strong>set_axes</strong></a>(self, axes)</dt><dd><tt>set the axes instance in which the artist resides, if any<br>
<br>
ACCEPTS: an axes instance</tt></dd></dl>
<dl><dt><a name="Legend-set_clip_box"><strong>set_clip_box</strong></a>(self, clipbox)</dt><dd><tt>Set the artist's clip Bbox<br>
<br>
ACCEPTS: a :class:`matplotlib.transform.Bbox` instance</tt></dd></dl>
<dl><dt><a name="Legend-set_clip_on"><strong>set_clip_on</strong></a>(self, b)</dt><dd><tt>Set whether artist uses clipping<br>
<br>
ACCEPTS: [True | False]</tt></dd></dl>
<dl><dt><a name="Legend-set_clip_path"><strong>set_clip_path</strong></a>(self, path, transform<font color="#909090">=None</font>)</dt><dd><tt>Set the artist's clip path, which may be:<br>
<br>
* a :class:`~matplotlib.patches.Patch` (or subclass) instance<br>
<br>
* a :class:`~matplotlib.path.Path` instance, in which case<br>
an optional :class:`~matplotlib.transforms.Transform`<br>
instance may be provided, which will be applied to the<br>
path before using it for clipping.<br>
<br>
* *None*, to remove the clipping path<br>
<br>
For efficiency, if the path happens to be an axis-aligned<br>
rectangle, this method will set the clipping box to the<br>
corresponding rectangle and set the clipping path to *None*.<br>
<br>
ACCEPTS: a :class:`~matplotlib.path.Path` instance and a<br>
:class:`~matplotlib.transforms.Transform` instance, a<br>
:class:`~matplotlib.patches.Patch` instance, or *None*.</tt></dd></dl>
<dl><dt><a name="Legend-set_contains"><strong>set_contains</strong></a>(self, picker)</dt><dd><tt>Replace the contains test used by this artist. The new picker should<br>
be a callable function which determines whether the artist is hit by the<br>
mouse event::<br>
<br>
hit, props = picker(artist, mouseevent)<br>
<br>
If the mouse event is over the artist, return *hit=True* and *props*<br>
is a dictionary of properties you want returned with the contains test.</tt></dd></dl>
<dl><dt><a name="Legend-set_figure"><strong>set_figure</strong></a>(self, fig)</dt><dd><tt>Set the :class:`~matplotlib.figure.Figure` instance the artist<br>
belongs to.<br>
<br>
ACCEPTS: a :class:`matplotlib.figure.Figure` instance</tt></dd></dl>
<dl><dt><a name="Legend-set_label"><strong>set_label</strong></a>(self, s)</dt><dd><tt>Set the line label to *s* for auto legend<br>
<br>
ACCEPTS: any string</tt></dd></dl>
<dl><dt><a name="Legend-set_lod"><strong>set_lod</strong></a>(self, on)</dt><dd><tt>Set Level of Detail on or off. If on, the artists may examine<br>
things like the pixel width of the axes and draw a subset of<br>
their contents accordingly<br>
<br>
ACCEPTS: [True | False]</tt></dd></dl>
<dl><dt><a name="Legend-set_picker"><strong>set_picker</strong></a>(self, picker)</dt><dd><tt>set the epsilon for picking used by this artist<br>
<br>
*picker* can be one of the following:<br>
<br>
* *None*: picking is disabled for this artist (default)<br>
<br>
* A boolean: if *True* then picking will be enabled and the<br>
artist will fire a pick event if the mouse event is over<br>
the artist<br>
<br>
* A float: if picker is a number it is interpreted as an<br>
epsilon tolerance in points and the artist will fire<br>
off an event if it's data is within epsilon of the mouse<br>
event. For some artists like lines and patch collections,<br>
the artist may provide additional data to the pick event<br>
that is generated, e.g. the indices of the data within<br>
epsilon of the pick event<br>
<br>
* A function: if picker is callable, it is a user supplied<br>
function which determines whether the artist is hit by the<br>
mouse event::<br>
<br>
hit, props = picker(artist, mouseevent)<br>
<br>
to determine the hit test. if the mouse event is over the<br>
artist, return *hit=True* and props is a dictionary of<br>
properties you want added to the PickEvent attributes.<br>
<br>
ACCEPTS: [None|float|boolean|callable]</tt></dd></dl>
<dl><dt><a name="Legend-set_transform"><strong>set_transform</strong></a>(self, t)</dt><dd><tt>Set the :class:`~matplotlib.transforms.Transform` instance<br>
used by this artist.</tt></dd></dl>
<dl><dt><a name="Legend-set_visible"><strong>set_visible</strong></a>(self, b)</dt><dd><tt>set the artist's visiblity<br>
<br>
ACCEPTS: [True | False]</tt></dd></dl>
<dl><dt><a name="Legend-set_zorder"><strong>set_zorder</strong></a>(self, level)</dt><dd><tt>Set the zorder for the artist<br>
<br>
ACCEPTS: any number</tt></dd></dl>
<dl><dt><a name="Legend-update"><strong>update</strong></a>(self, props)</dt></dl>
<dl><dt><a name="Legend-update_from"><strong>update_from</strong></a>(self, other)</dt><dd><tt>Copy properties from *other* to *self*.</tt></dd></dl>
<hr>
Data descriptors inherited from <a href="matplotlib.artist.html#Artist">matplotlib.artist.Artist</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
<hr>
Data and other attributes inherited from <a href="matplotlib.artist.html#Artist">matplotlib.artist.Artist</a>:<br>
<dl><dt><strong>aname</strong> = 'Artist'</dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
<td width="100%"><strong>division</strong> = _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)<br>
<strong>rcParams</strong> = {'figure.subplot.right': 0.90000000000000002, 'm...persize': 'letter', 'svg.embed_char_paths': True}</td></tr></table>
@footer@