You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
<divid="unreleased-message"> You are reading an old version of the documentation (v1.5.0). For the latest version see <ahref="https://matplotlib.org/stable/api/widgets_api.html">https://matplotlib.org/stable/api/widgets_api.html</a></div>
<spanid="matplotlib-widgets"></span><h2><aclass="reference internal" href="#module-matplotlib.widgets" title="matplotlib.widgets"><codeclass="xref py py-mod docutils literal"><spanclass="pre">matplotlib.widgets</span></code></a><aclass="headerlink" href="#module-matplotlib.widgets" title="Permalink to this headline">¶</a></h2>
<divclass="section" id="gui-neutral-widgets">
<h3>GUI Neutral widgets<aclass="headerlink" href="#gui-neutral-widgets" title="Permalink to this headline">¶</a></h3>
<p>Widgets that are designed to work for any of the GUI backends.
All of these widgets require you to predefine an <aclass="reference internal" href="axes_api.html#matplotlib.axes.Axes" title="matplotlib.axes.Axes"><codeclass="xref py py-class docutils literal"><spanclass="pre">matplotlib.axes.Axes</span></code></a>
instance and pass that as the first arg. matplotlib doesn’t try to
be too smart with respect to layout – you will have to figure out how
wide and tall you want your Axes to be to accommodate your widget.</p>
<dlclass="class">
<dtid="matplotlib.widgets.AxesWidget">
<emclass="property">class </em><codeclass="descclassname">matplotlib.widgets.</code><codeclass="descname">AxesWidget</code><spanclass="sig-paren">(</span><em>ax</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.AxesWidget" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">connect_event</code><spanclass="sig-paren">(</span><em>event</em>, <em>callback</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.AxesWidget.connect_event" title="Permalink to this definition">¶</a></dt>
<dd><p>Connect callback with an event.</p>
<p>This should be used in lieu of <codeclass="xref py py-obj docutils literal"><spanclass="pre">figure.canvas.mpl_connect</span></code> since this
function stores call back ids for later clean up.</p>
<codeclass="descname">disconnect_events</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.AxesWidget.disconnect_events" title="Permalink to this definition">¶</a></dt>
<dd><p>Disconnect all events created by this widget.</p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.widgets.Button">
<emclass="property">class </em><codeclass="descclassname">matplotlib.widgets.</code><codeclass="descname">Button</code><spanclass="sig-paren">(</span><em>ax</em>, <em>label</em>, <em>image=None</em>, <em>color='0.85'</em>, <em>hovercolor='0.95'</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.Button" title="Permalink to this definition">¶</a></dt>
<dd>The color of the button when not hovering.</dd>
<dt><em>hovercolor</em></dt>
<dd>The color of the button when hovering.</dd>
</dl>
</div></blockquote>
<p>Call <aclass="reference internal" href="#matplotlib.widgets.Button.on_clicked" title="matplotlib.widgets.Button.on_clicked"><codeclass="xref py py-meth docutils literal"><spanclass="pre">on_clicked()</span></code></a> to connect to the button</p>
<div><p>The image to place in the button, if not <em>None</em>.
Can be any legal arg to imshow (numpy array,
matplotlib Image instance, or Pillow Image).</p>
</div></blockquote>
<p><strong>color</strong> : color</p>
<blockquote>
<div><p>The color of the button when not activated</p>
</div></blockquote>
<p><strong>hovercolor</strong> : color</p>
<blockquoteclass="last">
<div><p>The color of the button when the mouse is over it</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<dlclass="method">
<dtid="matplotlib.widgets.Button.disconnect">
<codeclass="descname">disconnect</code><spanclass="sig-paren">(</span><em>cid</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.Button.disconnect" title="Permalink to this definition">¶</a></dt>
<dd><p>remove the observer with connection id <em>cid</em></p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.widgets.Button.on_clicked">
<codeclass="descname">on_clicked</code><spanclass="sig-paren">(</span><em>func</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.Button.on_clicked" title="Permalink to this definition">¶</a></dt>
<dd><p>When the button is clicked, call this <em>func</em> with event</p>
<p>A connection id is returned which can be used to disconnect</p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.widgets.CheckButtons">
<emclass="property">class </em><codeclass="descclassname">matplotlib.widgets.</code><codeclass="descname">CheckButtons</code><spanclass="sig-paren">(</span><em>ax</em>, <em>labels</em>, <em>actives</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.CheckButtons" title="Permalink to this definition">¶</a></dt>
<p>Connect to the CheckButtons with the <aclass="reference internal" href="#matplotlib.widgets.CheckButtons.on_clicked" title="matplotlib.widgets.CheckButtons.on_clicked"><codeclass="xref py py-meth docutils literal"><spanclass="pre">on_clicked()</span></code></a> method</p>
<codeclass="descname">disconnect</code><spanclass="sig-paren">(</span><em>cid</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.CheckButtons.disconnect" title="Permalink to this definition">¶</a></dt>
<dd><p>remove the observer with connection id <em>cid</em></p>
<codeclass="descname">on_clicked</code><spanclass="sig-paren">(</span><em>func</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.CheckButtons.on_clicked" title="Permalink to this definition">¶</a></dt>
<dd><p>When the button is clicked, call <em>func</em> with button label</p>
<p>A connection id is returned which can be used to disconnect</p>
<codeclass="descname">set_active</code><spanclass="sig-paren">(</span><em>index</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.CheckButtons.set_active" title="Permalink to this definition">¶</a></dt>
<dd><p>Directly (de)activate a check button by index.</p>
<dlclass="docutils">
<dt><em>index</em> is an index into the original label list</dt>
<dd>that this object was constructed with.
Raises ValueError if <em>index</em> is invalid.</dd>
</dl>
<p>Callbacks will be triggered if <codeclass="xref py py-attr docutils literal"><spanclass="pre">eventson</span></code> is True.</p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.widgets.Cursor">
<emclass="property">class </em><codeclass="descclassname">matplotlib.widgets.</code><codeclass="descname">Cursor</code><spanclass="sig-paren">(</span><em>ax</em>, <em>horizOn=True</em>, <em>vertOn=True</em>, <em>useblit=False</em>, <em>**lineprops</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.Cursor" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">clear</code><spanclass="sig-paren">(</span><em>event</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.Cursor.clear" title="Permalink to this definition">¶</a></dt>
<dd><p>clear the cursor</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.widgets.Cursor.onmove">
<codeclass="descname">onmove</code><spanclass="sig-paren">(</span><em>event</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.Cursor.onmove" title="Permalink to this definition">¶</a></dt>
<dd><p>on mouse motion draw the cursor if visible</p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.widgets.EllipseSelector">
<emclass="property">class </em><codeclass="descclassname">matplotlib.widgets.</code><codeclass="descname">EllipseSelector</code><spanclass="sig-paren">(</span><em>ax</em>, <em>onselect</em>, <em>drawtype='box'</em>, <em>minspanx=None</em>, <em>minspany=None</em>, <em>useblit=False</em>, <em>lineprops=None</em>, <em>rectprops=None</em>, <em>spancoords='data'</em>, <em>button=None</em>, <em>maxdist=10</em>, <em>marker_props=None</em>, <em>interactive=False</em>, <em>state_modifier_keys=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.EllipseSelector" title="Permalink to this definition">¶</a></dt>
<spanclass="k">print</span><spanclass="p">(</span><spanclass="s">' used button : '</span><spanclass="p">,</span><spanclass="n">eclick</span><spanclass="o">.</span><spanclass="n">button</span><spanclass="p">)</span>
<p>and clear the drawn box/line. The <codeclass="docutils literal"><spanclass="pre">pos_1</span></code> and <codeclass="docutils literal"><spanclass="pre">pos_2</span></code> are
arrays of length 2 containing the x- and y-coordinate.</p>
<p>If <em>minspanx</em> is not <em>None</em> then events smaller than <em>minspanx</em>
in x direction are ignored (it’s the same for y).</p>
<p>The rectangle is drawn with <em>rectprops</em>; default:</p>
<codeclass="descname">draw_shape</code><spanclass="sig-paren">(</span><em>extents</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.EllipseSelector.draw_shape" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.widgets.Lasso">
<emclass="property">class </em><codeclass="descclassname">matplotlib.widgets.</code><codeclass="descname">Lasso</code><spanclass="sig-paren">(</span><em>ax</em>, <em>xy</em>, <em>callback=None</em>, <em>useblit=True</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.Lasso" title="Permalink to this definition">¶</a></dt>
<p>The selected path can be used in conjunction with
<aclass="reference internal" href="path_api.html#matplotlib.path.Path.contains_point" title="matplotlib.path.Path.contains_point"><codeclass="xref py py-func docutils literal"><spanclass="pre">contains_point()</span></code></a> to select data points
from an image.</p>
<p>Unlike <aclass="reference internal" href="#matplotlib.widgets.LassoSelector" title="matplotlib.widgets.LassoSelector"><codeclass="xref py py-class docutils literal"><spanclass="pre">LassoSelector</span></code></a>, this must be initialized with a starting
point <codeclass="xref py py-obj docutils literal"><spanclass="pre">xy</span></code>, and the <aclass="reference internal" href="#matplotlib.widgets.Lasso" title="matplotlib.widgets.Lasso"><codeclass="xref py py-obj docutils literal"><spanclass="pre">Lasso</span></code></a> events are destroyed upon release.</p>
<dd>Whenever the lasso is released, the <codeclass="xref py py-obj docutils literal"><spanclass="pre">callback</span></code> function is called and
passed the vertices of the selected path.</dd>
</dl>
<dlclass="method">
<dtid="matplotlib.widgets.Lasso.onmove">
<codeclass="descname">onmove</code><spanclass="sig-paren">(</span><em>event</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.Lasso.onmove" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.widgets.Lasso.onrelease">
<codeclass="descname">onrelease</code><spanclass="sig-paren">(</span><em>event</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.Lasso.onrelease" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.widgets.LassoSelector">
<emclass="property">class </em><codeclass="descclassname">matplotlib.widgets.</code><codeclass="descname">LassoSelector</code><spanclass="sig-paren">(</span><em>ax</em>, <em>onselect=None</em>, <em>useblit=True</em>, <em>lineprops=None</em>, <em>button=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.LassoSelector" title="Permalink to this definition">¶</a></dt>
<p>For the selector to remain responsive you much keep a reference to
it.</p>
<p>The selected path can be used in conjunction with
<aclass="reference internal" href="path_api.html#matplotlib.path.Path.contains_point" title="matplotlib.path.Path.contains_point"><codeclass="xref py py-func docutils literal"><spanclass="pre">contains_point()</span></code></a> to select
data points from an image.</p>
<p>In contrast to <aclass="reference internal" href="#matplotlib.widgets.Lasso" title="matplotlib.widgets.Lasso"><codeclass="xref py py-class docutils literal"><spanclass="pre">Lasso</span></code></a>, <aclass="reference internal" href="#matplotlib.widgets.LassoSelector" title="matplotlib.widgets.LassoSelector"><codeclass="xref py py-obj docutils literal"><spanclass="pre">LassoSelector</span></code></a> is written with an interface
similar to <aclass="reference internal" href="#matplotlib.widgets.RectangleSelector" title="matplotlib.widgets.RectangleSelector"><codeclass="xref py py-class docutils literal"><spanclass="pre">RectangleSelector</span></code></a> and <aclass="reference internal" href="#matplotlib.widgets.SpanSelector" title="matplotlib.widgets.SpanSelector"><codeclass="xref py py-class docutils literal"><spanclass="pre">SpanSelector</span></code></a> and will
continue to interact with the axes until disconnected.</p>
*button* is a list of integers indicating which mouse buttons should
be used for rectangle selection. You can also specify a single
integer if only a single button is desired. Default is *None*,
which does not limit which button can be used.
Note, typically:
1 = left mouse button
2 = center mouse button (scroll wheel)
3 = right mouse button
</pre></div>
</div>
<dlclass="method">
<dtid="matplotlib.widgets.LassoSelector.onpress">
<codeclass="descname">onpress</code><spanclass="sig-paren">(</span><em>event</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.LassoSelector.onpress" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">onrelease</code><spanclass="sig-paren">(</span><em>event</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.LassoSelector.onrelease" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.widgets.LockDraw">
<emclass="property">class </em><codeclass="descclassname">matplotlib.widgets.</code><codeclass="descname">LockDraw</code><aclass="headerlink" href="#matplotlib.widgets.LockDraw" title="Permalink to this definition">¶</a></dt>
<p>Some widgets, like the cursor, draw onto the canvas, and this is not
desirable under all circumstances, like when the toolbar is in
zoom-to-rect mode and drawing a rectangle. The module level “lock”
allows someone to grab the lock and prevent other widgets from
drawing. Use <codeclass="docutils literal"><spanclass="pre">matplotlib.widgets.lock(someobj)</span></code> to pr</p>
<dlclass="method">
<dtid="matplotlib.widgets.LockDraw.available">
<codeclass="descname">available</code><spanclass="sig-paren">(</span><em>o</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.LockDraw.available" title="Permalink to this definition">¶</a></dt>
<dd><p>drawing is available to <em>o</em></p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.widgets.LockDraw.isowner">
<codeclass="descname">isowner</code><spanclass="sig-paren">(</span><em>o</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.LockDraw.isowner" title="Permalink to this definition">¶</a></dt>
<dd><p>Return True if <em>o</em> owns this lock</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.widgets.LockDraw.locked">
<codeclass="descname">locked</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.LockDraw.locked" title="Permalink to this definition">¶</a></dt>
<dd><p>Return True if the lock is currently held by an owner</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.widgets.LockDraw.release">
<codeclass="descname">release</code><spanclass="sig-paren">(</span><em>o</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.LockDraw.release" title="Permalink to this definition">¶</a></dt>
<dd><p>release the lock</p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.widgets.MultiCursor">
<emclass="property">class </em><codeclass="descclassname">matplotlib.widgets.</code><codeclass="descname">MultiCursor</code><spanclass="sig-paren">(</span><em>canvas</em>, <em>axes</em>, <em>useblit=True</em>, <em>horizOn=False</em>, <em>vertOn=True</em>, <em>**lineprops</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.MultiCursor" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">clear</code><spanclass="sig-paren">(</span><em>event</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.MultiCursor.clear" title="Permalink to this definition">¶</a></dt>
<dd><p>clear the cursor</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.widgets.MultiCursor.connect">
<codeclass="descname">connect</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.MultiCursor.connect" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">disconnect</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.MultiCursor.disconnect" title="Permalink to this definition">¶</a></dt>
<dd><p>disconnect events</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.widgets.MultiCursor.onmove">
<codeclass="descname">onmove</code><spanclass="sig-paren">(</span><em>event</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.MultiCursor.onmove" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.widgets.RadioButtons">
<emclass="property">class </em><codeclass="descclassname">matplotlib.widgets.</code><codeclass="descname">RadioButtons</code><spanclass="sig-paren">(</span><em>ax</em>, <em>labels</em>, <em>active=0</em>, <em>activecolor='blue'</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.RadioButtons" title="Permalink to this definition">¶</a></dt>
<dd>The <aclass="reference internal" href="axes_api.html#matplotlib.axes.Axes" title="matplotlib.axes.Axes"><codeclass="xref py py-class docutils literal"><spanclass="pre">matplotlib.axes.Axes</span></code></a> instance the buttons are in</dd>
<dt><em>activecolor</em></dt>
<dd>The color of the button when clicked</dd>
<dt><em>labels</em></dt>
<dd>A list of <aclass="reference internal" href="text_api.html#matplotlib.text.Text" title="matplotlib.text.Text"><codeclass="xref py py-class docutils literal"><spanclass="pre">matplotlib.text.Text</span></code></a> instances</dd>
<dt><em>circles</em></dt>
<dd>A list of <aclass="reference internal" href="patches_api.html#matplotlib.patches.Circle" title="matplotlib.patches.Circle"><codeclass="xref py py-class docutils literal"><spanclass="pre">matplotlib.patches.Circle</span></code></a> instances</dd>
<dt><em>value_selected</em></dt>
<dd>A string listing the current value selected</dd>
</dl>
</div></blockquote>
<p>Connect to the RadioButtons with the <aclass="reference internal" href="#matplotlib.widgets.RadioButtons.on_clicked" title="matplotlib.widgets.RadioButtons.on_clicked"><codeclass="xref py py-meth docutils literal"><spanclass="pre">on_clicked()</span></code></a> method</p>
<p>Add radio buttons to <aclass="reference internal" href="axes_api.html#matplotlib.axes.Axes" title="matplotlib.axes.Axes"><codeclass="xref py py-class docutils literal"><spanclass="pre">matplotlib.axes.Axes</span></code></a> instance <em>ax</em></p>
<dlclass="docutils">
<dt><em>labels</em></dt>
<dd>A len(buttons) list of labels as strings</dd>
<dt><em>active</em></dt>
<dd>The index into labels for the button that is active</dd>
<codeclass="descname">disconnect</code><spanclass="sig-paren">(</span><em>cid</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.RadioButtons.disconnect" title="Permalink to this definition">¶</a></dt>
<dd><p>remove the observer with connection id <em>cid</em></p>
<codeclass="descname">on_clicked</code><spanclass="sig-paren">(</span><em>func</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.RadioButtons.on_clicked" title="Permalink to this definition">¶</a></dt>
<dd><p>When the button is clicked, call <em>func</em> with button label</p>
<p>A connection id is returned which can be used to disconnect</p>
<codeclass="descname">set_active</code><spanclass="sig-paren">(</span><em>index</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.RadioButtons.set_active" title="Permalink to this definition">¶</a></dt>
<dd><p>Trigger which radio button to make active.</p>
<dlclass="docutils">
<dt><em>index</em> is an index into the original label list</dt>
<dd>that this object was constructed with.
Raise ValueError if the index is invalid.</dd>
</dl>
<p>Callbacks will be triggered if <codeclass="xref py py-attr docutils literal"><spanclass="pre">eventson</span></code> is True.</p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.widgets.RectangleSelector">
<emclass="property">class </em><codeclass="descclassname">matplotlib.widgets.</code><codeclass="descname">RectangleSelector</code><spanclass="sig-paren">(</span><em>ax</em>, <em>onselect</em>, <em>drawtype='box'</em>, <em>minspanx=None</em>, <em>minspany=None</em>, <em>useblit=False</em>, <em>lineprops=None</em>, <em>rectprops=None</em>, <em>spancoords='data'</em>, <em>button=None</em>, <em>maxdist=10</em>, <em>marker_props=None</em>, <em>interactive=False</em>, <em>state_modifier_keys=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.RectangleSelector" title="Permalink to this definition">¶</a></dt>
<spanclass="k">print</span><spanclass="p">(</span><spanclass="s">' used button : '</span><spanclass="p">,</span><spanclass="n">eclick</span><spanclass="o">.</span><spanclass="n">button</span><spanclass="p">)</span>
<p>and clear the drawn box/line. The <codeclass="docutils literal"><spanclass="pre">pos_1</span></code> and <codeclass="docutils literal"><spanclass="pre">pos_2</span></code> are
arrays of length 2 containing the x- and y-coordinate.</p>
<p>If <em>minspanx</em> is not <em>None</em> then events smaller than <em>minspanx</em>
in x direction are ignored (it’s the same for y).</p>
<p>The rectangle is drawn with <em>rectprops</em>; default:</p>
<codeclass="descname">center</code><aclass="headerlink" href="#matplotlib.widgets.RectangleSelector.center" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">corners</code><aclass="headerlink" href="#matplotlib.widgets.RectangleSelector.corners" title="Permalink to this definition">¶</a></dt>
<dd><p>Corners of rectangle from lower left, moving clockwise.</p>
<codeclass="descname">draw_shape</code><spanclass="sig-paren">(</span><em>extents</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.RectangleSelector.draw_shape" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">edge_centers</code><aclass="headerlink" href="#matplotlib.widgets.RectangleSelector.edge_centers" title="Permalink to this definition">¶</a></dt>
<dd><p>Midpoint of rectangle edges from left, moving clockwise.</p>
<codeclass="descname">extents</code><aclass="headerlink" href="#matplotlib.widgets.RectangleSelector.extents" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">geometry</code><aclass="headerlink" href="#matplotlib.widgets.RectangleSelector.geometry" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.widgets.Slider">
<emclass="property">class </em><codeclass="descclassname">matplotlib.widgets.</code><codeclass="descname">Slider</code><spanclass="sig-paren">(</span><em>ax</em>, <em>label</em>, <em>valmin</em>, <em>valmax</em>, <em>valinit=0.5</em>, <em>valfmt='%1.2f'</em>, <em>closedmin=True</em>, <em>closedmax=True</em>, <em>slidermin=None</em>, <em>slidermax=None</em>, <em>dragging=True</em>, <em>**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.Slider" title="Permalink to this definition">¶</a></dt>
<p><em>closedmin</em> : whether the slider is closed on the minimum</p>
<p><em>closedmax</em> : whether the slider is closed on the maximum</p>
<dlclass="docutils">
<dt><em>slidermin</em><spanclass="classifier-delimiter">:</span><spanclass="classifier">another slider - if not <em>None</em>, this slider must be</span></dt>
<dd>greater than <em>slidermin</em></dd>
<dt><em>slidermax</em><spanclass="classifier-delimiter">:</span><spanclass="classifier">another slider - if not <em>None</em>, this slider must be</span></dt>
<dd>less than <em>slidermax</em></dd>
</dl>
<pclass="last"><em>dragging</em> : allow for mouse dragging on slider</p>
</dd>
</dl>
<p>Call <aclass="reference internal" href="#matplotlib.widgets.Slider.on_changed" title="matplotlib.widgets.Slider.on_changed"><codeclass="xref py py-meth docutils literal"><spanclass="pre">on_changed()</span></code></a> to connect to the slider event</p>
<p>Create a slider from <em>valmin</em> to <em>valmax</em> in axes <em>ax</em>.</p>
<p>additional kwargs are passed on to <codeclass="docutils literal"><spanclass="pre">self.poly</span></code> which is the
<aclass="reference internal" href="patches_api.html#matplotlib.patches.Rectangle" title="matplotlib.patches.Rectangle"><codeclass="xref py py-class docutils literal"><spanclass="pre">matplotlib.patches.Rectangle</span></code></a> which draws the slider
knob. See the <aclass="reference internal" href="patches_api.html#matplotlib.patches.Rectangle" title="matplotlib.patches.Rectangle"><codeclass="xref py py-class docutils literal"><spanclass="pre">matplotlib.patches.Rectangle</span></code></a> documentation
<div><p>if the slider can be dragged by the mouse</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<dlclass="method">
<dtid="matplotlib.widgets.Slider.disconnect">
<codeclass="descname">disconnect</code><spanclass="sig-paren">(</span><em>cid</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.Slider.disconnect" title="Permalink to this definition">¶</a></dt>
<dd><p>remove the observer with connection id <em>cid</em></p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.widgets.Slider.on_changed">
<codeclass="descname">on_changed</code><spanclass="sig-paren">(</span><em>func</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.Slider.on_changed" title="Permalink to this definition">¶</a></dt>
<dd><p>When the slider value is changed, call <em>func</em> with the new
slider position</p>
<p>A connection id is returned which can be used to disconnect</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.widgets.Slider.reset">
<codeclass="descname">reset</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.Slider.reset" title="Permalink to this definition">¶</a></dt>
<dd><p>reset the slider to the initial value if needed</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.widgets.Slider.set_val">
<codeclass="descname">set_val</code><spanclass="sig-paren">(</span><em>val</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.Slider.set_val" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.widgets.SpanSelector">
<emclass="property">class </em><codeclass="descclassname">matplotlib.widgets.</code><codeclass="descname">SpanSelector</code><spanclass="sig-paren">(</span><em>ax</em>, <em>onselect</em>, <em>direction</em>, <em>minspan=None</em>, <em>useblit=False</em>, <em>rectprops=None</em>, <em>onmove_callback=None</em>, <em>span_stays=False</em>, <em>button=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.SpanSelector" title="Permalink to this definition">¶</a></dt>
<p>Set the visible attribute to <em>False</em> if you want to turn off
the functionality of the span selector</p>
<p>If <em>span_stays</em> is True, the span stays visble after making
a valid selection.</p>
<p><em>button</em> is a list of integers indicating which mouse buttons should
be used for selection. You can also specify a single
integer if only a single button is desired. Default is <em>None</em>,
which does not limit which button can be used.</p>
<dlclass="docutils">
<dt>Note, typically:</dt>
<dd>1 = left mouse button
2 = center mouse button (scroll wheel)
3 = right mouse button</dd>
</dl>
<dlclass="method">
<dtid="matplotlib.widgets.SpanSelector.ignore">
<codeclass="descname">ignore</code><spanclass="sig-paren">(</span><em>event</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.SpanSelector.ignore" title="Permalink to this definition">¶</a></dt>
<dd><p>return <em>True</em> if <em>event</em> should be ignored</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.widgets.SpanSelector.new_axes">
<codeclass="descname">new_axes</code><spanclass="sig-paren">(</span><em>ax</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.SpanSelector.new_axes" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.widgets.SubplotTool">
<emclass="property">class </em><codeclass="descclassname">matplotlib.widgets.</code><codeclass="descname">SubplotTool</code><spanclass="sig-paren">(</span><em>targetfig</em>, <em>toolfig</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.SubplotTool" title="Permalink to this definition">¶</a></dt>
<p>A tool to adjust to subplot params of a <aclass="reference internal" href="figure_api.html#matplotlib.figure.Figure" title="matplotlib.figure.Figure"><codeclass="xref py py-class docutils literal"><spanclass="pre">matplotlib.figure.Figure</span></code></a></p>
<dlclass="docutils">
<dt><em>targetfig</em></dt>
<dd>The figure instance to adjust</dd>
<dt><em>toolfig</em></dt>
<dd>The figure instance to embed the subplot tool into. If
None, a default figure will be created. If you are using
<codeclass="descname">funcbottom</code><spanclass="sig-paren">(</span><em>val</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.SubplotTool.funcbottom" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">funchspace</code><spanclass="sig-paren">(</span><em>val</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.widgets.SubplotTool.funchspace" title="Permalink to this definition">¶</a></dt>