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
Lint: tabs to spaces.
  • Loading branch information
heathhenley committed Feb 23, 2017
commit 9f4258b456a49f463f87ac05a44fd1cbbeb10c5c
12 changes: 6 additions & 6 deletions lib/matplotlib/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,11 @@ def __init__(self, ax, label, valmin, valmax, valinit=0.5, valfmt='%1.2f',

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add the default on the line that defines the parameter?
(note that it is currently not indented properly).


valfmt : str, optional
Used to format the slider value, fprint format string.
Default: '%1.2f'
Default: '%1.2f'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same (Can you add the default on the line that defines the parameter?)


closedmin : bool, optional
Indicate whether the slider interval is closed on the bottom.
Expand Down Expand Up @@ -370,11 +370,11 @@ def __init__(self, ax, label, valmin, valmax, valinit=0.5, valfmt='%1.2f',
self.slidermin = slidermin
self.slidermax = slidermax
self.drag_active = False
self._value_in_bounds(valinit)
self._value_in_bounds(valinit)

def _value_in_bounds(self, val):
""" Makes sure self.val is with given bounds."""
if val <= self.valmin:
if val <= self.valmin:
if not self.closedmin:
return
val = self.valmin
Expand Down Expand Up @@ -416,8 +416,8 @@ def _update(self, event):
event.canvas.release_mouse(self.ax)
return
val = event.xdata
self._value_in_bounds(val)
self._value_in_bounds(val)

def set_val(self, val):
xy = self.poly.xy
xy[2] = val, 1
Expand Down