Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f169460

Browse files
committed
Fix and improve docstring.
Class links were incorrect.
1 parent 0f0286e commit f169460

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

lib/matplotlib/widgets.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,16 @@ class Widget(object):
6464

6565

6666
class 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

0 commit comments

Comments
 (0)