Skip to content

Commit b475d32

Browse files
committed
Minor cleanups.
1 parent e086a5d commit b475d32

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/matplotlib/scale.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ def limit_range_for_scale(self, vmin, vmax, minpos):
262262
"""
263263
Limit the domain to positive values.
264264
"""
265-
return (vmin <= 0.0 and minpos or vmin,
266-
vmax <= 0.0 and minpos or vmax)
265+
return (minpos if vmin <= 0 else vmin,
266+
minpos if vmax <= 0 else vmax)
267267

268268

269269
class SymmetricalLogTransform(Transform):
@@ -497,8 +497,8 @@ def limit_range_for_scale(self, vmin, vmax, minpos):
497497
"""
498498
Limit the domain to values between 0 and 1 (excluded).
499499
"""
500-
return (vmin <= 0 and minpos or vmin,
501-
vmax >= 1 and (1 - minpos) or vmax)
500+
return (minpos if vmin <= 0 else minpos,
501+
1 - minpos if vmax >= 1 else vmax)
502502

503503

504504
_scale_mapping = {

0 commit comments

Comments
 (0)