Skip to content

Commit 0dcb21f

Browse files
committed
Safer handling of the minimum positive value in log locators.
svn path=/branches/v1_0_maint/; revision=8749
1 parent 73ca17b commit 0dcb21f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/ticker.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,7 @@ def __call__(self):
12441244

12451245
if vmin <= 0.0:
12461246
vmin = self.axis.get_minpos()
1247-
if vmin <= 0.0:
1247+
if vmin <= 0.0 or not np.isfinite(vmin):
12481248
raise ValueError(
12491249
"Data has no positive values, and therefore can not be log-scaled.")
12501250

@@ -1292,7 +1292,7 @@ def view_limits(self, vmin, vmax):
12921292

12931293
minpos = self.axis.get_minpos()
12941294

1295-
if minpos<=0:
1295+
if minpos<=0 or not np.isfinite(minpos):
12961296
raise ValueError(
12971297
"Data has no positive values, and therefore can not be log-scaled.")
12981298

0 commit comments

Comments
 (0)