Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Update Slider docs and type check slidermin and slidermax. #8134

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

Merged
merged 10 commits into from
Feb 25, 2017
Merged
Prev Previous commit
Next Next commit
Doc nit.
  • Loading branch information
heathhenley committed Feb 24, 2017
commit 9d3e5e1e5066eaa5071647724f4222b663d35577
24 changes: 10 additions & 14 deletions lib/matplotlib/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ class Slider(AxesWidget):
"""
A slider representing a floating point range.

Create a slider from *valmin* to *valmax* in axes *ax*. For the slider to
Create a slider from `valmin` to `valmax` in axes `ax`. For the slider to
remain responsive you must maintain a reference to it.

Call :meth:`on_changed` to connect to the slider event
Expand All @@ -290,8 +290,7 @@ def __init__(self, ax, label, valmin, valmax, valinit=0.5, valfmt='%1.2f',
The maximum value of the slider.

valinit : float, optional
The slider initial position.
Default: 0.5
The slider initial position. Default: 0.5

valfmt : str, optional
Used to format the slider value, fprint format string.
Expand All @@ -307,24 +306,21 @@ def __init__(self, ax, label, valmin, valmax, valinit=0.5, valfmt='%1.2f',

slidermin : Slider, optional
Do not allow the current slider to have a value less than
`slidermin.val`.
Default: None
the value of the Slider `slidermin`. Default: None

slidermax : Slider, optional
Do not allow the current slider to have a value greater than
`slidermax.val`.
Default: None
the value of the Slider `slidermax`. Default: None

dragging : bool, optional
If True the slider can be dragged by the mouse.
Default: True
If True the slider can be dragged by the mouse. Default: True

Notes
----------
-----
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*, ...).
: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`).
"""
AxesWidget.__init__(self, ax)

Expand Down Expand Up @@ -392,7 +388,7 @@ def _value_in_bounds(self, val):
if not self.closedmax:
return
val = self.slidermax.val
self.set_val(val)
return val

def _update(self, event):
"""update the slider position"""
Expand Down