265 lines (225 with data), 17.9 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>.widgets</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/widgets.py">/usr/lib/python2.4/site-packages/matplotlib/widgets.py</a></font></td></tr></table>
<p><tt>GUI Neutral widgets<br>
<br>
All of these widgets require you to predefine an Axes instance and<br>
pass that as the first arg. matplotlib doesn't try to be too smart in<br>
layout -- you have to figure out how wide and tall you want your Axes<br>
to be to accommodate your widget.</tt></p>
<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.widgets.html#Widget">Widget</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="matplotlib.widgets.html#Button">Button</a>
</font></dt><dt><font face="helvetica, arial"><a href="matplotlib.widgets.html#CheckButtons">CheckButtons</a>
</font></dt><dt><font face="helvetica, arial"><a href="matplotlib.widgets.html#RadioButtons">RadioButtons</a>
</font></dt><dt><font face="helvetica, arial"><a href="matplotlib.widgets.html#Slider">Slider</a>
</font></dt><dt><font face="helvetica, arial"><a href="matplotlib.widgets.html#SubplotTool">SubplotTool</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="Button">class <strong>Button</strong></a>(<a href="matplotlib.widgets.html#Widget">Widget</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>A GUI neutral button<br>
<br>
The following attributes are accesible<br>
<br>
ax - the Axes the button renders into<br>
label - a text.Text instance<br>
color - the color of the button when not hovering<br>
hovercolor - the color of the button when hovering<br>
<br>
Call "on_clicked" to connect to the button<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Button-__init__"><strong>__init__</strong></a>(self, ax, label, image<font color="#909090">=None</font>, color<font color="#909090">=0.84999999999999998</font>, hovercolor<font color="#909090">=0.94999999999999996</font>)</dt><dd><tt>ax is the Axes instance the button will be placed into<br>
<br>
label is a string which is the button text<br>
<br>
image if not None, is an image to place in the button -- can<br>
be any legal arg to imshow (array, matplotlib Image<br>
instance, or PIL image)<br>
<br>
color is the color of the button when not activated<br>
<br>
hovercolor is the color of the button when the mouse is over<br>
it</tt></dd></dl>
<dl><dt><a name="Button-disconnect"><strong>disconnect</strong></a>(self, cid)</dt><dd><tt>remove the observer with connection id cid</tt></dd></dl>
<dl><dt><a name="Button-on_clicked"><strong>on_clicked</strong></a>(self, func)</dt><dd><tt>When the button is clicked, call this func with event<br>
<br>
A connection id is returned which can be used to disconnect</tt></dd></dl>
<hr>
Data and other attributes inherited from <a href="matplotlib.widgets.html#Widget">Widget</a>:<br>
<dl><dt><strong>drawon</strong> = True</dl>
<dl><dt><strong>eventson</strong> = True</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="CheckButtons">class <strong>CheckButtons</strong></a>(<a href="matplotlib.widgets.html#Widget">Widget</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>A GUI neutral radio button<br>
<br>
The following attributes are exposed<br>
<br>
ax - the Axes instance the buttons are in<br>
labels - a list of text.Text instances<br>
lines - a list of (line1, line2) tuples for the x's in the check boxes.<br>
These lines exist for each box, but have set_visible(False) when<br>
box is not checked<br>
rectangles - a list of patch.Rectangle instances<br>
<br>
Connect to the <a href="#CheckButtons">CheckButtons</a> with the on_clicked method<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="CheckButtons-__init__"><strong>__init__</strong></a>(self, ax, labels, actives)</dt><dd><tt>Add check buttons to axes.Axes instance ax<br>
<br>
labels is a len(buttons) list of labels as strings<br>
<br>
actives is a len(buttons) list of booleans indicating whether<br>
the button is active</tt></dd></dl>
<dl><dt><a name="CheckButtons-disconnect"><strong>disconnect</strong></a>(self, cid)</dt><dd><tt>remove the observer with connection id cid</tt></dd></dl>
<dl><dt><a name="CheckButtons-on_clicked"><strong>on_clicked</strong></a>(self, func)</dt><dd><tt>When the button is clicked, call this func with button label<br>
<br>
A connection id is returned which can be used to disconnect</tt></dd></dl>
<hr>
Data and other attributes inherited from <a href="matplotlib.widgets.html#Widget">Widget</a>:<br>
<dl><dt><strong>drawon</strong> = True</dl>
<dl><dt><strong>eventson</strong> = True</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="RadioButtons">class <strong>RadioButtons</strong></a>(<a href="matplotlib.widgets.html#Widget">Widget</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>A GUI neutral radio button<br>
<br>
The following attributes are exposed<br>
<br>
ax - the Axes instance the buttons are in<br>
activecolor - the color of the button when clicked<br>
labels - a list of text.Text instances<br>
circles - a list of patch.Circle instances<br>
<br>
Connect to the <a href="#RadioButtons">RadioButtons</a> with the on_clicked method<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="RadioButtons-__init__"><strong>__init__</strong></a>(self, ax, labels, active<font color="#909090">=0</font>, activecolor<font color="#909090">='blue'</font>)</dt><dd><tt>Add radio buttons to axes.Axes instance ax<br>
<br>
labels is a len(buttons) list of labels as strings<br>
<br>
active is the index into labels for the button that is active<br>
<br>
activecolor is the color of the button when clicked</tt></dd></dl>
<dl><dt><a name="RadioButtons-disconnect"><strong>disconnect</strong></a>(self, cid)</dt><dd><tt>remove the observer with connection id cid</tt></dd></dl>
<dl><dt><a name="RadioButtons-on_clicked"><strong>on_clicked</strong></a>(self, func)</dt><dd><tt>When the button is clicked, call this func with button label<br>
<br>
A connection id is returned which can be used to disconnect</tt></dd></dl>
<hr>
Data and other attributes inherited from <a href="matplotlib.widgets.html#Widget">Widget</a>:<br>
<dl><dt><strong>drawon</strong> = True</dl>
<dl><dt><strong>eventson</strong> = True</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="Slider">class <strong>Slider</strong></a>(<a href="matplotlib.widgets.html#Widget">Widget</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>A slider representing a floating point range<br>
<br>
The following attributes are defined <br>
ax : the slider axes.Axes instance<br>
val : the current slider value<br>
vline : a Line2D instance representing the initial value<br>
poly : A patch.Polygon instance which is the slider<br>
valfmt : the format string for formatting the slider text<br>
label : a text.Text instance, the slider label<br>
closedmin : whether the slider is closed on the minimum <br>
closedmax : whether the slider is closed on the maximum<br>
slidermin : another slider - if not None, this slider must be > slidermin<br>
slidermax : another slider - if not None, this slider must be < slidermax<br>
<br>
<br>
Call on_changed to connect to the slider event<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Slider-__init__"><strong>__init__</strong></a>(self, ax, label, valmin, valmax, valinit<font color="#909090">=0.5</font>, valfmt<font color="#909090">='%1.2f'</font>, closedmin<font color="#909090">=True</font>, closedmax<font color="#909090">=True</font>, slidermin<font color="#909090">=None</font>, slidermax<font color="#909090">=None</font>)</dt><dd><tt>Create a slider from valmin to valmax in axes ax;<br>
<br>
label is the slider label valinit is the slider initial position<br>
<br>
valfmt is used to format the slider value<br>
<br>
closedmin and closedmax indicated whether the slider interval is closed<br>
<br>
slidermin and slidermax can be used to contrain the value of<br>
this slider to the values of other sliders.</tt></dd></dl>
<dl><dt><a name="Slider-disconnect"><strong>disconnect</strong></a>(self, cid)</dt><dd><tt>remove the observer with connection id cid</tt></dd></dl>
<dl><dt><a name="Slider-on_changed"><strong>on_changed</strong></a>(self, func)</dt><dd><tt>When the slider valud is changed, call this func with the new<br>
slider position<br>
<br>
A connection id is returned which can be used to disconnect</tt></dd></dl>
<dl><dt><a name="Slider-reset"><strong>reset</strong></a>(self)</dt><dd><tt>reset the slider to the initial value</tt></dd></dl>
<hr>
Data and other attributes inherited from <a href="matplotlib.widgets.html#Widget">Widget</a>:<br>
<dl><dt><strong>drawon</strong> = True</dl>
<dl><dt><strong>eventson</strong> = True</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="SubplotTool">class <strong>SubplotTool</strong></a>(<a href="matplotlib.widgets.html#Widget">Widget</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>A tool to adjust to subplot params of fig<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="SubplotTool-__init__"><strong>__init__</strong></a>(self, targetfig, toolfig)</dt><dd><tt>targetfig is the figure to adjust<br>
<br>
toolfig is the figure to embed the the subplot tool into. If<br>
None, a default pylab figure will be created. If you are<br>
using this from the GUI</tt></dd></dl>
<dl><dt><a name="SubplotTool-funcbottom"><strong>funcbottom</strong></a>(self, val)</dt></dl>
<dl><dt><a name="SubplotTool-funchspace"><strong>funchspace</strong></a>(self, val)</dt></dl>
<dl><dt><a name="SubplotTool-funcleft"><strong>funcleft</strong></a>(self, val)</dt></dl>
<dl><dt><a name="SubplotTool-funcright"><strong>funcright</strong></a>(self, val)</dt></dl>
<dl><dt><a name="SubplotTool-functop"><strong>functop</strong></a>(self, val)</dt></dl>
<dl><dt><a name="SubplotTool-funcwspace"><strong>funcwspace</strong></a>(self, val)</dt></dl>
<hr>
Data and other attributes inherited from <a href="matplotlib.widgets.html#Widget">Widget</a>:<br>
<dl><dt><strong>drawon</strong> = True</dl>
<dl><dt><strong>eventson</strong> = True</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="Widget">class <strong>Widget</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>OK, I couldn't resist; abstract base class for mpl GUI neutral<br>
widgets<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Data and other attributes defined here:<br>
<dl><dt><strong>drawon</strong> = True</dl>
<dl><dt><strong>eventson</strong> = True</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="-array"><strong>array</strong></a>(...)</dt><dd><tt><a href="#-array">array</a>(sequence, typecode=None, copy=1, savespace=0) will return a new array formed from the given (potentially nested) sequence with type given by typecode. If no typecode is given, then the type will be determined as the minimum type required to hold the objects in sequence. If copy is zero and sequence is already an array, a reference will be returned. If savespace is nonzero, the new array will maintain its precision in operations.</tt></dd></dl>
</td></tr></table>
@footer@