Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit35be770

Browse files
committed
Simplify stride logic
1 parenta8c8729 commit35be770

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

‎lib/matplotlib/ticker.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2351,17 +2351,7 @@ def tick_values(self, vmin, vmax):
23512351
# Get decades between major ticks.
23522352
stride= (max(math.ceil(numdec/ (numticks-1)),1)
23532353
ifmpl.rcParams['_internal.classic_mode']else
2354-
numdec//numticks)
2355-
2356-
ifstride>numdec:
2357-
# If we have decided that the stride is bigger than the range, clip
2358-
# the stride back to the available range - 1 with a floor of 1.
2359-
# This prevents getting axis with only 1 tick visible.
2360-
stride=max(1,numdec)
2361-
elifstride==0:
2362-
# If requesting more ticks than decades, make sure we always have
2363-
# at least a single stride
2364-
stride=1
2354+
max(numdec//numticks,1))
23652355

23662356
# Does subs include anything other than 1? Essentially a hack to know
23672357
# whether we're a major or a minor locator.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp