Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up some widget docstrings #10106

Merged
merged 2 commits into from
Dec 27, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 25 additions & 27 deletions lib/matplotlib/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,22 +141,18 @@ class Button(AxesWidget):
A GUI neutral button.

For the button to remain responsive you must keep a reference to it.
Call :meth:`on_clicked` to connect to the button.

The following attributes are accessible

*ax*
Attributes
----------
ax :
The :class:`matplotlib.axes.Axes` the button renders into.

*label*
label :
A :class:`matplotlib.text.Text` instance.

*color*
color :
The color of the button when not hovering.

*hovercolor*
hovercolor :
The color of the button when hovering.

Call :meth:`on_clicked` to connect to the button
"""

def __init__(self, ax, label, image=None,
Expand Down Expand Up @@ -2451,7 +2447,8 @@ def _rect_bbox(self):


class LassoSelector(_SelectorWidget):
"""Selection curve of an arbitrary shape.
"""
Selection curve of an arbitrary shape.

For the selector to remain responsive you must keep a reference to
it.
Expand All @@ -2464,14 +2461,6 @@ class LassoSelector(_SelectorWidget):
similar to :class:`RectangleSelector` and :class:`SpanSelector` and will
continue to interact with the axes until disconnected.

Parameters:

*ax* : :class:`~matplotlib.axes.Axes`
The parent axes for the widget.
*onselect* : function
Whenever the lasso is released, the `onselect` function is called and
passed the vertices of the selected path.

Example usage::

ax = subplot(111)
Expand All @@ -2481,15 +2470,24 @@ def onselect(verts):
print(verts)
lasso = LassoSelector(ax, onselect)

*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.
Parameters
----------
ax : :class:`~matplotlib.axes.Axes`
The parent axes for the widget.
onselect : function
Whenever the lasso is released, the *onselect* function is called and
passed the vertices of the selected path.
button : list[Int], optional
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

- 1 = left mouse button
- 2 = center mouse button (scroll wheel)
- 3 = right mouse button

"""

Expand Down