Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 144aa6b

Browse files
committed
Merge pull request #5760 from mdboom/log-limits
Fix #5753. Handle minpos in log scale
2 parents f0e0822 + b1f1692 commit 144aa6b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/matplotlib/ticker.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1642,17 +1642,17 @@ def view_limits(self, vmin, vmax):
16421642
vmin = b ** (vmax - self.numdecs)
16431643
return vmin, vmax
16441644

1645-
if rcParams['axes.autolimit_mode'] == 'round_numbers':
1646-
minpos = self.axis.get_minpos()
1645+
minpos = self.axis.get_minpos()
16471646

1648-
if minpos <= 0 or not np.isfinite(minpos):
1649-
raise ValueError(
1650-
"Data has no positive values, and therefore can not be "
1651-
"log-scaled.")
1647+
if minpos <= 0 or not np.isfinite(minpos):
1648+
raise ValueError(
1649+
"Data has no positive values, and therefore can not be "
1650+
"log-scaled.")
16521651

1653-
if vmin <= minpos:
1654-
vmin = minpos
1652+
if vmin <= minpos:
1653+
vmin = minpos
16551654

1655+
if rcParams['axes.autolimit_mode'] == 'round_numbers':
16561656
if not is_decade(vmin, self._base):
16571657
vmin = decade_down(vmin, self._base)
16581658
if not is_decade(vmax, self._base):

0 commit comments

Comments
 (0)