8000 Changed is to ==, and sets to lists · matplotlib/matplotlib@db065bf · GitHub
[go: up one dir, main page]

Skip to content

Commit db065bf

Browse files
Changed is to ==, and sets to lists
1 parent 602759e commit db065bf

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/matplotlib/widgets.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def __init__(self, ax, label, valmin, valmax, valinit=0.5, valfmt='%1.2f',
311311
valstep : float, optional, default: None
312312
If given, the slider will snap to multiples of `valstep`.
313313
314-
orientation : {'horizontal', 'vertical'}
314+
orientation : str, 'horizontal' or 'vertical', default: 'horizontal'
315315
The orientation of the slider.
316316
317317
Notes
@@ -329,7 +329,7 @@ def __init__(self, ax, label, valmin, valmax, valinit=0.5, valfmt='%1.2f',
329329
if slidermax is not None and not hasattr(slidermax, 'val'):
330330
raise ValueError("Argument slidermax ({}) has no 'val'"
331331
.format(type(slidermax)))
332-
if orientation not in {'horizontal', 'vertical'}:
332+
if orientation not in ['horizontal', 'vertical']:
333333
raise ValueError("Argument orientation ({}) must be either"
334334
"'horizontal' or 'vertical'".format(orientation))
335335

@@ -347,7 +347,7 @@ def __init__(self, ax, label, valmin, valmax, valinit=0.5, valfmt='%1.2f',
347347
valinit = valmin
348348
self.val = valinit
349349
self.valinit = valinit
350-
if orientation is 'vertical':
350+
if orientation == 'vertical':
351351
self.poly = ax.axhspan(valmin, valinit, 0, 1, **kwargs)
352352
self.hline = ax.axhline(valinit, 0, 1, color='r', lw=1)
353353
else:
@@ -356,7 +356,7 @@ def __init__(self, ax, label, valmin, valmax, valinit=0.5, valfmt='%1.2f',
356356

357357
self.valfmt = valfmt
358358
ax.set_yticks([])
359-
if orientation is 'vertical':
359+
if orientation == 'vertical':
360360
ax.set_ylim((valmin, valmax))
361361
else:
362362
ax.set_xlim((valmin, valmax))
@@ -367,7 +367,7 @@ def __init__(self, ax, label, valmin, valmax, valinit=0.5, valfmt='%1.2f',
367367
self.connect_event('button_release_event', self._update)
368368
if dragging:
369369
self.connect_event('motion_notify_event', self._update)
370-
if orientation is 'vertical':
370+
if orientation == 'vertical':
371371
self.label = ax.text(0.5, 1.02, label, transform=ax.transAxes,
372372
verticalalignment='bottom',
373373
horizontalalignment='center')
@@ -438,7 +438,7 @@ def _update(self, event):
438438
self.drag_active = False
439439
event.canvas.release_mouse(self.ax)
440440
return
441-
if self.orientation is 'vertical':
441+
if self.orientation == 'vertical':
442442
val = self._value_in_bounds(event.ydata)
443443
else:
444444
val = self._value_in_bounds(event.xdata)
@@ -454,7 +454,7 @@ def set_val(self, val):
454454
val : float
455455
"""
456456
xy = self.poly.xy
457-
if self.orientation is 'vertical':
457+
if self.orientation == 'vertical':
458458
xy[1] = 0, val
459459
xy[2] = 1, val
460460
else:

0 commit comments

Comments
 (0)
0