File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,15 +64,16 @@ class Widget(object):
6464
6565
6666class AxesWidget (Widget ):
67- """
68- Widget that is connected to a single :class:`Axes`.
69-
70- Attributes
71- ----------
72- *ax*
73- The parent :class:`matplotlib.axes.Axes` for the widget
74- *canvas*
75- The parent FigureCanvas for the widget
67+ """Widget that is connected to a single :class:`~matplotlib.axes.Axes`.
68+
69+ Attributes:
70+
71+ *ax* : :class:`~matplotlib.axes.Axes`
72+ The parent axes for the widget
73+ *canvas* : :class:`~matplotlib.backend_bases.FigureCanvasBase` subclass
74+ The parent figure canvs for the widget.
75+ *active* : bool
76+ If False, the widget does not respond to events.
7677 """
7778 def __init__ (self , ax ):
7879 self .ax = ax
@@ -81,10 +82,16 @@ def __init__(self, ax):
8182 self .active = True
8283
8384 def connect_event (self , event , callback ):
85+ """Connect callback with an event.
86+
87+ This should be used in lieu of `figure.canvas.mpl_connect` since this
88+ function stores call back ids for later clean up.
89+ """
8490 cid = self .canvas .mpl_connect (event , callback )
8591 self .cids .append (cid )
8692
8793 def disconnect_events (self ):
94+ """Disconnect all events created by this widget."""
8895 for c in self .cids :
8996 self .canvas .mpl_disconnect (c )
9097
You can’t perform that action at this time.
0 commit comments