384 lines (322 with data), 27.7 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>.artist</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/artist.py">/home/jdhunter/dev/lib64/python2.5/site-packages/matplotlib/artist.py</a></font></td></tr></table>
<p></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="re.html">re</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="__builtin__.html#object">__builtin__.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="matplotlib.artist.html#Artist">Artist</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="matplotlib.artist.html#ArtistInspector">ArtistInspector</a>
</font></dt></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="Artist">class <strong>Artist</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Abstract base class for someone who renders into a FigureCanvas<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Artist-__init__"><strong>__init__</strong></a>(self)</dt></dl>
<dl><dt><a name="Artist-add_callback"><strong>add_callback</strong></a>(self, func)</dt></dl>
<dl><dt><a name="Artist-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="Artist-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="Artist-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="Artist-draw"><strong>draw</strong></a>(self, renderer, *args, **kwargs)</dt><dd><tt>Derived classes drawing method</tt></dd></dl>
<dl><dt><a name="Artist-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="Artist-get_animated"><strong>get_animated</strong></a>(self)</dt><dd><tt>return the artist's animated state</tt></dd></dl>
<dl><dt><a name="Artist-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="Artist-get_clip_box"><strong>get_clip_box</strong></a>(self)</dt><dd><tt>Return artist clipbox</tt></dd></dl>
<dl><dt><a name="Artist-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="Artist-get_clip_path"><strong>get_clip_path</strong></a>(self)</dt><dd><tt>Return artist clip path</tt></dd></dl>
<dl><dt><a name="Artist-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="Artist-get_figure"><strong>get_figure</strong></a>(self)</dt><dd><tt>return the figure instance</tt></dd></dl>
<dl><dt><a name="Artist-get_label"><strong>get_label</strong></a>(self)</dt></dl>
<dl><dt><a name="Artist-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="Artist-get_transform"><strong>get_transform</strong></a>(self)</dt><dd><tt>return the Transformation instance used by this artist</tt></dd></dl>
<dl><dt><a name="Artist-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 transformation applied,<br>
and the remaining affine part of its transformation.</tt></dd></dl>
<dl><dt><a name="Artist-get_visible"><strong>get_visible</strong></a>(self)</dt><dd><tt>return the artist's visiblity</tt></dd></dl>
<dl><dt><a name="Artist-get_zorder"><strong>get_zorder</strong></a>(self)</dt></dl>
<dl><dt><a name="Artist-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="Artist-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="Artist-is_figure_set"><strong>is_figure_set</strong></a>(self)</dt></dl>
<dl><dt><a name="Artist-is_transform_set"><strong>is_transform_set</strong></a>(self)</dt><dd><tt><a href="#Artist">Artist</a> has transform explicity let</tt></dd></dl>
<dl><dt><a name="Artist-pchanged"><strong>pchanged</strong></a>(self)</dt><dd><tt>fire event when property changed</tt></dd></dl>
<dl><dt><a name="Artist-pick"><strong>pick</strong></a>(self, mouseevent)</dt><dd><tt><a href="#Artist-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="Artist-pickable"><strong>pickable</strong></a>(self)</dt><dd><tt>return True if self is pickable</tt></dd></dl>
<dl><dt><a name="Artist-remove"><strong>remove</strong></a>(self)</dt><dd><tt>Remove the artist from the figure if possible. The effect will not<br>
be visible until the figure is redrawn, e.g., with ax.draw_idle().<br>
Call ax.relim() to update the axes limits if desired.<br>
<br>
Note: relim() will not see collections even if the collection<br>
was added to axes with autolim=True.<br>
<br>
Note: there is no support for removing the artist's legend entry.</tt></dd></dl>
<dl><dt><a name="Artist-remove_callback"><strong>remove_callback</strong></a>(self, oid)</dt></dl>
<dl><dt><a name="Artist-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="Artist-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="Artist-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="Artist-set_axes"><strong>set_axes</strong></a>(self, axes)</dt><dd><tt>set the axes instance the artist resides in, if any<br>
<br>
ACCEPTS: an axes instance</tt></dd></dl>
<dl><dt><a name="Artist-set_clip_box"><strong>set_clip_box</strong></a>(self, clipbox)</dt><dd><tt>Set the artist's clip Bbox<br>
<br>
ACCEPTS: a matplotlib.transform.Bbox instance</tt></dd></dl>
<dl><dt><a name="Artist-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="Artist-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) a Patch (or subclass) instance<br>
<br>
b) a Path instance, in which cas aoptional transform may<br>
be provided, which will be applied to the path before using it<br>
for clipping.<br>
<br>
c) 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 Path instance and a Transform instance, a Patch<br>
instance, or None</tt></dd></dl>
<dl><dt><a name="Artist-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="Artist-set_figure"><strong>set_figure</strong></a>(self, fig)</dt><dd><tt>Set the figure instance the artist belong to<br>
<br>
ACCEPTS: a matplotlib.figure.Figure instance</tt></dd></dl>
<dl><dt><a name="Artist-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="Artist-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="Artist-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>
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>
float - if picker is a number it is interpreted as an<br>
epsilon tolerance in points and the 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, eg the indices of the data within<br>
epsilon of the pick event<br>
<br>
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="Artist-set_transform"><strong>set_transform</strong></a>(self, t)</dt><dd><tt>set the Transformation instance used by this artist<br>
<br>
ACCEPTS: a matplotlib.transform transformation instance</tt></dd></dl>
<dl><dt><a name="Artist-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="Artist-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="Artist-update"><strong>update</strong></a>(self, props)</dt></dl>
<dl><dt><a name="Artist-update_from"><strong>update_from</strong></a>(self, other)</dt><dd><tt>copy properties from other to self</tt></dd></dl>
<hr>
Data descriptors defined here:<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 defined here:<br>
<dl><dt><strong>aname</strong> = 'Artist'</dl>
<dl><dt><strong>zorder</strong> = 0</dl>
</td></tr></table> <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="ArtistInspector">class <strong>ArtistInspector</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>A helper class to inspect an <a href="#Artist">Artist</a> and return information about<br>
it's settable properties and their current values<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="ArtistInspector-__init__"><strong>__init__</strong></a>(self, o)</dt><dd><tt>Initialize the artist inspector with an artist or sequence of<br>
artists. Id a sequence is used, we assume it is a homogeneous<br>
sequence (all Artists are of the same type) and it is your<br>
responsibility to make sure this is so.</tt></dd></dl>
<dl><dt><a name="ArtistInspector-aliased_name"><strong>aliased_name</strong></a>(self, s)</dt><dd><tt>return 'PROPNAME or alias' if s has an alias, else return<br>
PROPNAME.<br>
<br>
Eg for the line markerfacecolor property, which has an alias,<br>
return 'markerfacecolor or mfc' and for the transform<br>
property, which does not, return 'transform'</tt></dd></dl>
<dl><dt><a name="ArtistInspector-get_aliases"><strong>get_aliases</strong></a>(self)</dt><dd><tt>get a dict mapping fullname -> alias for each alias in o.<br>
Eg for lines::<br>
<br>
{'markerfacecolor': 'mfc',<br>
'linewidth' : 'lw',<br>
}</tt></dd></dl>
<dl><dt><a name="ArtistInspector-get_setters"><strong>get_setters</strong></a>(self)</dt><dd><tt>Get the attribute strings with setters for <a href="__builtin__.html#object">object</a> h. Eg, for a line,<br>
return ['markerfacecolor', 'linewidth', ....]</tt></dd></dl>
<dl><dt><a name="ArtistInspector-get_valid_values"><strong>get_valid_values</strong></a>(self, attr)</dt><dd><tt>get the legal arguments for the setter associated with attr<br>
<br>
This is done by querying the doc string of the function set_attr<br>
for a line that begins with ACCEPTS:<br>
<br>
Eg, for a line linestyle, return<br>
[ '-' | '--' | '-.' | ':' | 'steps' | 'None' ]</tt></dd></dl>
<dl><dt><a name="ArtistInspector-is_alias"><strong>is_alias</strong></a>(self, o)</dt><dd><tt>return true if method <a href="__builtin__.html#object">object</a> o is an alias for another function</tt></dd></dl>
<dl><dt><a name="ArtistInspector-pprint_getters"><strong>pprint_getters</strong></a>(self)</dt><dd><tt>return the getters and actual values as list of strings'</tt></dd></dl>
<dl><dt><a name="ArtistInspector-pprint_setters"><strong>pprint_setters</strong></a>(self, prop<font color="#909090">=None</font>, leadingspace<font color="#909090">=2</font>)</dt><dd><tt>if prop is None, return a list of strings of all settable properies<br>
and their valid values<br>
<br>
if prop is not None, it is a valid property name and that<br>
property will be returned as a string of property : valid<br>
values</tt></dd></dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt><a name="-get"><strong>get</strong></a>(o, *args, **kwargs)</dt><dd><tt>Return the value of handle property s<br>
<br>
h is an instance of a class, eg a Line2D or an Axes or Text.<br>
if s is 'somename', this function returns<br>
<br>
o.get_somename()<br>
<br>
getp can be used to query all the gettable properties with <a href="#-getp">getp</a>(o)<br>
Many properties have aliases for shorter typing, eg 'lw' is an<br>
alias for 'linewidth'. In the output, aliases and full property<br>
names will be listed as<br>
<br>
property or alias = value<br>
<br>
eg<br>
<br>
linewidth or lw = 2</tt></dd></dl>
<dl><dt><a name="-getp"><strong>getp</strong></a>(o, *args)</dt><dd><tt>Return the value of handle property s<br>
<br>
h is an instance of a class, eg a Line2D or an Axes or Text.<br>
if s is 'somename', this function returns<br>
<br>
o.get_somename()<br>
<br>
getp can be used to query all the gettable properties with <a href="#-getp">getp</a>(o)<br>
Many properties have aliases for shorter typing, eg 'lw' is an<br>
alias for 'linewidth'. In the output, aliases and full property<br>
names will be listed as<br>
<br>
property or alias = value<br>
<br>
eg<br>
<br>
linewidth or lw = 2</tt></dd></dl>
<dl><dt><a name="-kwdoc"><strong>kwdoc</strong></a>(a)</dt></dl>
<dl><dt><a name="-setp"><strong>setp</strong></a>(h, *args, **kwargs)</dt><dd><tt>matplotlib supports the use of setp ("set property") and getp to set<br>
and get <a href="__builtin__.html#object">object</a> properties, as well as to do introspection on the<br>
<a href="__builtin__.html#object">object</a> For example, to set the linestyle of a line to be dashed, you<br>
can do<br>
<br>
>>> line, = plot([1,2,3])<br>
>>> <a href="#-setp">setp</a>(line, linestyle='--')<br>
<br>
If you want to know the valid types of arguments, you can provide the<br>
name of the property you want to set without a value<br>
<br>
>>> <a href="#-setp">setp</a>(line, 'linestyle')<br>
linestyle: [ '-' | '--' | '-.' | ':' | 'steps' | 'None' ]<br>
<br>
If you want to see all the properties that can be set, and their<br>
possible values, you can do<br>
<br>
<br>
>>> <a href="#-setp">setp</a>(line)<br>
... long output listing omitted'<br>
<br>
setp operates on a single instance or a list of instances. If you<br>
are in query mode introspecting the possible values, only the first<br>
instance in the sequence is used. When actually setting values,<br>
all the instances will be set. Eg, suppose you have a list of two<br>
lines, the following will make both lines thicker and red<br>
<br>
>>> x = arange(0,1.0,0.01)<br>
>>> y1 = sin(2*pi*x)<br>
>>> y2 = sin(4*pi*x)<br>
>>> lines = plot(x, y1, x, y2)<br>
>>> <a href="#-setp">setp</a>(lines, linewidth=2, color='r')<br>
<br>
setp works with the matlab(TM) style string/value pairs or with<br>
python kwargs. For example, the following are equivalent<br>
<br>
>>> <a href="#-setp">setp</a>(lines, 'linewidth', 2, 'color', r') # matlab style<br>
>>> <a href="#-setp">setp</a>(lines, linewidth=2, color='r') # python style</tt></dd></dl>
</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>kwdocd</strong> = {'Artist': ' alpha: float<font color="#c040c0">\n</font> animated: [True | False]<font color="#c040c0">\n</font> ... visible: [True | False]<font color="#c040c0">\n</font> zorder: any number'}</td></tr></table>
@footer@