Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f169460

Browse filesBrowse files
committed
Fix and improve docstring.
Class links were incorrect.
1 parent 0f0286e commit f169460
Copy full SHA for f169460

File tree

Expand file treeCollapse file tree

1 file changed

+16
-9
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+16
-9
lines changed

‎lib/matplotlib/widgets.py

Copy file name to clipboardExpand all lines: lib/matplotlib/widgets.py
+16-9Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.