1
1
"""
2
- GUI Neutral widgets
2
+ GUI neutral widgets
3
3
===================
4
4
5
5
Widgets that are designed to work for any of the GUI backends.
6
- All of these widgets require you to predefine an :class:`matplotlib.axes.Axes`
6
+ All of these widgets require you to predefine a :class:`matplotlib.axes.Axes`
7
7
instance and pass that as the first arg. matplotlib doesn't try to
8
8
be too smart with respect to layout -- you will have to figure out how
9
9
wide and tall you want your Axes to be to accommodate your widget.
@@ -30,9 +30,9 @@ class LockDraw(object):
30
30
desirable under all circumstances, like when the toolbar is in
31
31
zoom-to-rect mode and drawing a rectangle. The module level "lock"
32
32
allows someone to grab the lock and prevent other widgets from
33
- drawing. Use ``matplotlib.widgets.lock(someobj)`` to pr
33
+ drawing. Use ``matplotlib.widgets.lock(someobj)`` to prevent
34
+ other widgets from drawing while you're interacting with the canvas.
34
35
"""
35
- # FIXME: This docstring ends abruptly without...
36
36
37
37
def __init__ (self ):
38
38
self ._owner = None
@@ -124,7 +124,7 @@ def connect_event(self, event, callback):
124
124
"""Connect callback with an event.
125
125
126
126
This should be used in lieu of `figure.canvas.mpl_connect` since this
127
- function stores call back ids for later clean up.
127
+ function stores callback ids for later clean up.
128
128
"""
129
129
cid = self .canvas .mpl_connect (event , callback )
130
130
self .cids .append (cid )
@@ -139,8 +139,7 @@ class Button(AxesWidget):
139
139
"""
140
140
A GUI neutral button.
141
141
142
- For the button to remain responsive
143
- you must keep a reference to it.
142
+ For the button to remain responsive you must keep a reference to it.
144
143
145
144
The following attributes are accessible
146
145
@@ -244,9 +243,10 @@ def _motion(self, event):
244
243
245
244
def on_clicked (self , func ):
246
245
"""
247
- When the button is clicked, call this *func* with event
246
+ When the button is clicked, call this *func* with event.
248
247
249
- A connection id is returned which can be used to disconnect
248
+ A connection id is returned. It can be used to disconnect
249
+ the button from its callback.
250
250
"""
251
251
cid = self .cnt
252
252
self .observers [cid ] = func
@@ -265,8 +265,8 @@ class Slider(AxesWidget):
265
265
"""
266
266
A slider representing a floating point range.
267
267
268
- For the slider
269
- to remain responsive you must maintain a reference to it.
268
+ For the slider to remain responsive you must maintain a
269
+ reference to it.
270
270
271
271
The following attributes are defined
272
272
*ax* : the slider :class:`matplotlib.axes.Axes` instance
@@ -304,10 +304,10 @@ def __init__(self, ax, label, valmin, valmax, valinit=0.5, valfmt='%1.2f',
304
304
"""
305
305
Create a slider from *valmin* to *valmax* in axes *ax*.
306
306
307
- additional kwargs are passed on to ``self.poly`` which is the
308
- :class:`matplotlib.patches.Rectangle` which draws the slider
309
- knob. See the :class:`matplotlib.patches.Rectangle` documentation
310
- valid property names (e.g., *facecolor*, *edgecolor*, *alpha*, ...)
307
+ Additional kwargs are passed on to ``self.poly`` which is the
308
+ :class:`matplotlib.patches.Rectangle` that draws the slider
309
+ knob. See the :class:`matplotlib.patches.Rectangle` documentation for
310
+ valid property names (e.g., *facecolor*, *edgecolor*, *alpha*, ...).
311
311
312
312
Parameters
313
313
----------
@@ -476,7 +476,7 @@ class CheckButtons(AxesWidget):
476
476
"""
477
477
A GUI neutral radio button.
478
478
479
- For the check buttons to remain responsive you much keep a
479
+ For the check buttons to remain responsive you must keep a
480
480
reference to this object.
481
481
482
482
The following attributes are exposed
@@ -624,12 +624,12 @@ def disconnect(self, cid):
624
624
625
625
class RadioButtons (AxesWidget ):
626
626
"""
627
- A GUI neutral radio button
627
+ A GUI neutral radio button.
628
628
629
629
For the buttons to remain responsive
630
- you much keep a reference to this object.
630
+ you must keep a reference to this object.
631
631
632
- The following attributes are exposed
632
+ The following attributes are exposed:
633
633
634
634
*ax*
635
635
The :class:`matplotlib.axes.Axes` instance the buttons are in
@@ -772,16 +772,16 @@ def disconnect(self, cid):
772
772
773
773
class SubplotTool (Widget ):
774
774
"""
775
- A tool to adjust to subplot params of a :class:`matplotlib.figure.Figure`
775
+ A tool to adjust the subplot params of a :class:`matplotlib.figure.Figure`.
776
776
"""
777
777
def __init__ (self , targetfig , toolfig ):
778
778
"""
779
779
*targetfig*
780
- The figure instance to adjust
780
+ The figure instance to adjust.
781
781
782
782
*toolfig*
783
783
The figure instance to embed the subplot tool into. If
784
- None, a default figure will be created. If you are using
784
+ * None* , a default figure will be created. If you are using
785
785
this from the GUI
786
786
"""
787
787
# FIXME: The docstring seems to just abruptly end without...
@@ -921,9 +921,9 @@ def funchspace(self, val):
921
921
922
922
class Cursor (AxesWidget ):
923
923
"""
924
- A horizontal and vertical line span the axes that and move with
925
- the pointer. You can turn off the hline or vline spectively with
926
- the attributes
924
+ A horizontal and vertical line that spans the axes and moves with
925
+ the pointer. You can turn off the hline or vline respectively with
926
+ the following attributes:
927
927
928
928
*horizOn*
929
929
Controls the visibility of the horizontal line
@@ -933,7 +933,7 @@ class Cursor(AxesWidget):
933
933
934
934
and the visibility of the cursor itself with the *visible* attribute.
935
935
936
- For the cursor to remain responsive you much keep a reference to
936
+ For the cursor to remain responsive you must keep a reference to
937
937
it.
938
938
"""
939
939
def __init__ (self , ax , horizOn = True , vertOn = True , useblit = False ,
@@ -1018,7 +1018,7 @@ class MultiCursor(Widget):
1018
1018
Provide a vertical (default) and/or horizontal line cursor shared between
1019
1019
multiple axes.
1020
1020
1021
- For the cursor to remain responsive you much keep a reference to
1021
+ For the cursor to remain responsive you must keep a reference to
1022
1022
it.
1023
1023
1024
1024
Example usage::
@@ -1366,7 +1366,7 @@ class SpanSelector(_SelectorWidget):
1366
1366
"""
1367
1367
Select a min/max range of the x or y axes for a matplotlib Axes.
1368
1368
1369
- For the selector to remain responsive you much keep a reference to
1369
+ For the selector to remain responsive you must keep a reference to
1370
1370
it.
1371
1371
1372
1372
Example usage::
@@ -1630,7 +1630,7 @@ class RectangleSelector(_SelectorWidget):
1630
1630
"""
1631
1631
Select a rectangular region of an axes.
1632
1632
1633
- For the cursor to remain responsive you much keep a reference to
1633
+ For the cursor to remain responsive you must keep a reference to
1634
1634
it.
1635
1635
1636
1636
Example usage::
@@ -2045,7 +2045,7 @@ class EllipseSelector(RectangleSelector):
2045
2045
"""
2046
2046
Select an elliptical region of an axes.
2047
2047
2048
- For the cursor to remain responsive you much keep a reference to
2048
+ For the cursor to remain responsive you must keep a reference to
2049
2049
it.
2050
2050
2051
2051
Example usage::
@@ -2115,7 +2115,7 @@ def _rect_bbox(self):
2115
2115
class LassoSelector (_SelectorWidget ):
2116
2116
"""Selection curve of an arbitrary shape.
2117
2117
2118
- For the selector to remain responsive you much keep a reference to
2118
+ For the selector to remain responsive you must keep a reference to
2119
2119
it.
2120
2120
2121
2121
The selected path can be used in conjunction with
0 commit comments