Skip to content

Commit dfa8367

Browse files
committed
LogitLocator: merge two warnings in nonsingular method
1 parent 787f6b8 commit dfa8367

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

lib/matplotlib/ticker.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2800,18 +2800,14 @@ def nonsingular(self, vmin, vmax):
28002800
vmin, vmax = vmax, vmin
28012801
if not np.isfinite(vmin) or not np.isfinite(vmax):
28022802
vmin, vmax = initial_range # Initial range, no data plotted yet.
2803-
elif vmax <= 0:
2803+
elif vmax <= 0 or vmin >= 1:
2804+
# vmax <= 0 occurs when all values are negative
2805+
# vmin >= 1 occurs when all values are greater than one
28042806
cbook._warn_external(
2805-
"Data has no positive values, and therefore cannot be "
2807+
"Data has no values between 0 and 1, and therefore cannot be "
28062808
"logit-scaled."
28072809
)
28082810
vmin, vmax = initial_range
2809-
elif vmin >= 1:
2810-
cbook._warn_external(
2811-
"Data has no values smaller than one, and therefore cannot "
2812-
"be logit-scaled."
2813-
)
2814-
vmin, vmax = initial_range
28152811
else:
28162812
minpos = (
28172813
self.axis.get_minpos()

0 commit comments

Comments
 (0)