Skip to content

Commit 874e6ea

Browse files
committed
mnt: simplify stride calculation in LogLocator.tick_values
1 parent 503356e commit 874e6ea

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/matplotlib/ticker.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2386,8 +2386,7 @@ def tick_values(self, vmin, vmax):
23862386
# Get decades between major ticks.
23872387
stride = (max(math.ceil(numdec / (numticks - 1)), 1)
23882388
if mpl.rcParams['_internal.classic_mode'] else
2389-
next(s for s in itertools.count(1)
2390-
if numdec // s + 1 <= numticks))
2389+
numdec // numticks + 1)
23912390

23922391
# if we have decided that the stride is as big or bigger than
23932392
# the range, clip the stride back to the available range - 1

0 commit comments

Comments
 (0)