diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py index 94042a59e3bf..6ad69063c25c 100644 --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -1,9 +1,9 @@ """ -GUI Neutral widgets +GUI neutral widgets =================== Widgets that are designed to work for any of the GUI backends. -All of these widgets require you to predefine an :class:`matplotlib.axes.Axes` +All of these widgets require you to predefine a :class:`matplotlib.axes.Axes` instance and pass that as the first arg. matplotlib doesn't try to be too smart with respect to layout -- you will have to figure out how wide and tall you want your Axes to be to accommodate your widget. @@ -30,9 +30,9 @@ class LockDraw(object): desirable under all circumstances, like when the toolbar is in zoom-to-rect mode and drawing a rectangle. The module level "lock" allows someone to grab the lock and prevent other widgets from - drawing. Use ``matplotlib.widgets.lock(someobj)`` to pr + drawing. Use ``matplotlib.widgets.lock(someobj)`` to prevent + other widgets from drawing while you're interacting with the canvas. """ - # FIXME: This docstring ends abruptly without... def __init__(self): self._owner = None @@ -124,7 +124,7 @@ def connect_event(self, event, callback): """Connect callback with an event. This should be used in lieu of `figure.canvas.mpl_connect` since this - function stores call back ids for later clean up. + function stores callback ids for later clean up. """ cid = self.canvas.mpl_connect(event, callback) self.cids.append(cid) @@ -139,8 +139,7 @@ class Button(AxesWidget): """ A GUI neutral button. - For the button to remain responsive - you must keep a reference to it. + For the button to remain responsive you must keep a reference to it. The following attributes are accessible @@ -244,9 +243,10 @@ def _motion(self, event): def on_clicked(self, func): """ - When the button is clicked, call this *func* with event + When the button is clicked, call this *func* with event. - A connection id is returned which can be used to disconnect + A connection id is returned. It can be used to disconnect + the button from its callback. """ cid = self.cnt self.observers[cid] = func @@ -265,8 +265,8 @@ class Slider(AxesWidget): """ A slider representing a floating point range. - For the slider - to remain responsive you must maintain a reference to it. + For the slider to remain responsive you must maintain a + reference to it. The following attributes are defined *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', """ Create a slider from *valmin* to *valmax* in axes *ax*. - additional kwargs are passed on to ``self.poly`` which is the - :class:`matplotlib.patches.Rectangle` which draws the slider - knob. See the :class:`matplotlib.patches.Rectangle` documentation - valid property names (e.g., *facecolor*, *edgecolor*, *alpha*, ...) + Additional kwargs are passed on to ``self.poly`` which is the + :class:`matplotlib.patches.Rectangle` that draws the slider + knob. See the :class:`matplotlib.patches.Rectangle` documentation for + valid property names (e.g., *facecolor*, *edgecolor*, *alpha*, ...). Parameters ---------- @@ -476,7 +476,7 @@ class CheckButtons(AxesWidget): """ A GUI neutral radio button. - For the check buttons to remain responsive you much keep a + For the check buttons to remain responsive you must keep a reference to this object. The following attributes are exposed @@ -624,12 +624,12 @@ def disconnect(self, cid): class RadioButtons(AxesWidget): """ - A GUI neutral radio button + A GUI neutral radio button. For the buttons to remain responsive - you much keep a reference to this object. + you must keep a reference to this object. - The following attributes are exposed + The following attributes are exposed: *ax* The :class:`matplotlib.axes.Axes` instance the buttons are in @@ -772,16 +772,16 @@ def disconnect(self, cid): class SubplotTool(Widget): """ - A tool to adjust to subplot params of a :class:`matplotlib.figure.Figure` + A tool to adjust the subplot params of a :class:`matplotlib.figure.Figure`. """ def __init__(self, targetfig, toolfig): """ *targetfig* - The figure instance to adjust + The figure instance to adjust. *toolfig* The figure instance to embed the subplot tool into. If - None, a default figure will be created. If you are using + *None*, a default figure will be created. If you are using this from the GUI """ # FIXME: The docstring seems to just abruptly end without... @@ -921,9 +921,9 @@ def funchspace(self, val): class Cursor(AxesWidget): """ - A horizontal and vertical line span the axes that and move with - the pointer. You can turn off the hline or vline spectively with - the attributes + A horizontal and vertical line that spans the axes and moves with + the pointer. You can turn off the hline or vline respectively with + the following attributes: *horizOn* Controls the visibility of the horizontal line @@ -933,7 +933,7 @@ class Cursor(AxesWidget): and the visibility of the cursor itself with the *visible* attribute. - For the cursor to remain responsive you much keep a reference to + For the cursor to remain responsive you must keep a reference to it. """ def __init__(self, ax, horizOn=True, vertOn=True, useblit=False, @@ -1018,7 +1018,7 @@ class MultiCursor(Widget): Provide a vertical (default) and/or horizontal line cursor shared between multiple axes. - For the cursor to remain responsive you much keep a reference to + For the cursor to remain responsive you must keep a reference to it. Example usage:: @@ -1366,7 +1366,7 @@ class SpanSelector(_SelectorWidget): """ Select a min/max range of the x or y axes for a matplotlib Axes. - For the selector to remain responsive you much keep a reference to + For the selector to remain responsive you must keep a reference to it. Example usage:: @@ -1630,7 +1630,7 @@ class RectangleSelector(_SelectorWidget): """ Select a rectangular region of an axes. - For the cursor to remain responsive you much keep a reference to + For the cursor to remain responsive you must keep a reference to it. Example usage:: @@ -2045,7 +2045,7 @@ class EllipseSelector(RectangleSelector): """ Select an elliptical region of an axes. - For the cursor to remain responsive you much keep a reference to + For the cursor to remain responsive you must keep a reference to it. Example usage:: @@ -2115,7 +2115,7 @@ def _rect_bbox(self): class LassoSelector(_SelectorWidget): """Selection curve of an arbitrary shape. - For the selector to remain responsive you much keep a reference to + For the selector to remain responsive you must keep a reference to it. The selected path can be used in conjunction with