8000 DOC: numpydoc-ify widget.Slider. · matplotlib/matplotlib@a4694a0 · GitHub
[go: up one dir, main page]

Skip to content

Commit a4694a0

Browse files
committed
DOC: numpydoc-ify widget.Slider.
1 parent a34c859 commit a4694a0

File tree

1 file changed

+33
-59
lines changed

1 file changed

+33
-59
lines changed

lib/matplotlib/widgets.py

Lines changed: 33 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -266,91 +266,65 @@ class Slider(AxesWidget):
266266
"""
267267
A slider representing a floating point range.
268268
269-
For the slider to remain responsive you must maintain a
270-
reference to it.
271-
272-
The following attributes are defined
273-
*ax* : the slider :class:`matplotlib.axes.Axes` instance
274-
275-
*val* : the current slider value
276-
277-
*vline* : a :class:`matplotlib.lines.Line2D` instance
278-
representing the initial value of the slider
279-
280-
*poly* : A :class:`matplotlib.patches.Polygon` instance
281-
which is the slider knob
282-
283-
*valfmt* : the format string for formatting the slider text
284-
285-
*label* : a :class:`matplotlib.text.Text` instance
286-
for the slider label
287-
288-
*closedmin* : whether the slider is closed on the minimum
289-
290-
*closedmax* : whether the slider is closed on the maximum
291-
292-
*slidermin* : another slider - if not *None*, this slider must be
293-
greater than *slidermin*
294-
295-
*slidermax* : another slider - if not *None*, this slider must be
296-
less than *slidermax*
297-
298-
*dragging* : allow for mouse dragging on slider
269+
Create a slider from *valmin* to *valmax* in axes *ax*. For the slider to
270+
remain responsive you must maintain a reference to it.
299271
300272
Call :meth:`on_changed` to connect to the slider event
301273
"""
302274
def __init__(self, ax, label, valmin, valmax, valinit=0.5, valfmt='%1.2f',
303275
closedmin=True, closedmax=True, slidermin=None,
304276
slidermax=None, dragging=True, **kwargs):
305277
"""
306-
Create a slider from *valmin* to *valmax* in axes *ax*.
307-
308-
Additional kwargs are passed on to ``self.poly`` which is the
309-
:class:`matplotlib.patches.Rectangle` that draws the slider
310-
knob. See the :class:`matplotlib.patches.Rectangle` documentation for
311-
valid property names (e.g., *facecolor*, *edgecolor*, *alpha*, ...).
312-
313278
Parameters
314279
----------
315280
ax : Axes
316-
The Axes to put the slider in
281+
The Axes to put the slider in.
317282
318283
label : str
319-
Slider label
284+
Slider label.
320285
321286
valmin : float
322-
The minimum value of the slider
287+
The minimum value of the slider.
323288
324289
valmax : float
325-
The maximum value of the slider
326-
327-
valinit : float
328-
The slider initial position
290+
The maximum value of the slider.
329291
330-
label : str
331-
The slider label
292+
valinit : float, optional
293+
The slider initial position.
294+
Default: 0.5
332295
333-
valfmt : str
334-
Used to format the slider value, fprint format string
296+
valfmt : str, optional
297+
Used to format the slider value, fprint format string.
298+
Default: '%1.2f'
335299
336-
closedmin : bool
337-
Indicate whether the slider interval is closed on the bottom
300+
closedmin : bool, optional
301+
Indicate whether the slider interval is closed on the bottom.
302+
Default: True
338303
339-
closedmax : bool
340-
Indicate whether the slider interval is closed on the top
304+
closedmax : bool, optional
305+
Indicate whether the slider interval is closed on the top.
306+
Default: True
341307
342-
slidermin : Slider or None
308+
slidermin : Slider, optional
343309
Do not allow the current slider to have a value less than
344-
`slidermin`
310+
`slidermin.val`.
311+
Default: None
345312
346-
slidermax : Slider or None
313+
slidermax : Slider, optional
347314
Do not allow the current slider to have a value greater than
348-
`slidermax`
315+
`slidermax.val`.
316+
Default: None
349317
318+
dragging : bool, optional
319+
If True the slider can be dragged by the mouse.
320+
Default: True
350321
351-
dragging : bool
352-
if the slider can be dragged by the mouse
353-
322+
Notes
323+
----------
324+
Additional kwargs are passed on to ``self.poly`` which is the
325+
:class:`matplotlib.patches.Rectangle` that draws the slider
326+
knob. See the :class:`matplotlib.patches.Rectangle` documentation for
327+
valid property names (e.g., *facecolor*, *edgecolor*, *alpha*, ...).
354328
"""
355329
AxesWidget.__init__(self, ax)
356330

0 commit comments

Comments
 (0)
0