258 lines (215 with data), 17.8 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:/usr/lib/python2.4/site-packages/matplotlib/artist.py">/usr/lib/python2.4/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="sys.html">sys</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">Artist</a>
</font></dt><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></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-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_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_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_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_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-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-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_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_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_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 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 insect 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: {'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 object 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 object 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>)</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>
get can be used to query all the gettable properties with <a href="#-get">get</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>
get can be used to query all the gettable properties with <a href="#-get">get</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="-set"><strong>set</strong></a>(*args, **kwargs)</dt></dl>
<dl><dt><a name="-setp"><strong>setp</strong></a>(h, *args, **kwargs)</dt><dd><tt>matlab(TM) and pylab allow you to use set and get to set and get<br>
object properties, as well as to do introspection on the object<br>
For example, to set the linestyle of a line to be dashed, you can do<br>
<br>
>>> line, = plot([1,2,3])<br>
>>> <a href="#-set">set</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="#-set">set</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="#-set">set</a>(line)<br>
... long output listing omitted'<br>
<br>
set operates on a single instance or a list of instances. If you are<br>
in quey mode introspecting the possible values, only the first<br>
instance in the sequnce is used. When actually setting values, all<br>
the instances will be set. Eg, suppose you have a list of two lines,<br>
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="#-set">set</a>(lines, linewidth=2, color='r')<br>
<br>
Set works with the matlab(TM) style string/value pairs or with python<br>
kwargs. For example, the following are equivalent<br>
<br>
>>> <a href="#-set">set</a>(lines, 'linewidth', 2, 'color', r') # matlab style<br>
>>> <a href="#-set">set</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)</td></tr></table>
@footer@