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

Skip to content

Commit 1081385

Browse files
committed
Merge pull request #6060 from tacaswell/fix_infinite_ticker_loop
Fix infinite ticker loop
2 parents 1156e23 + be40bd5 commit 1081385

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/matplotlib/ticker.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,6 +1503,7 @@ def __init__(self, base=10.0, subs=[1.0], numdecs=4, numticks=15):
15031503
"""
15041504
self.base(base)
15051505
self.subs(subs)
1506+
# this needs to be validated > 1 with traitlets
15061507
self.numticks = numticks
15071508
self.numdecs = numdecs
15081509

@@ -1575,6 +1576,9 @@ def tick_values(self, vmin, vmax):
15751576
subs = self._subs
15761577

15771578
stride = 1
1579+
if not self.numticks > 1:
1580+
raise RuntimeError('The number of ticks must be greater than 1 '
1581+
'for LogLocator.')
15781582
while numdec / stride + 1 > self.numticks:
15791583
stride += 1
15801584

0 commit comments

Comments
 (0)