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

Skip to content

ticker: cast argument to int to avoid numpy warning #7583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 7, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/matplotlib/ticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -928,10 +928,12 @@ def set_locs(self, locs=None):
# Add labels between bases at log-spaced coefficients;
# include base powers in case the locations include
# "major" and "minor" points, as in colorbar.
c = np.logspace(0, 1, b//2 + 1, base=b)
c = np.logspace(0, 1, int(b)//2 + 1, base=b)
self._sublabels = set(np.round(c))
# For base 10, this yields (1, 2, 3, 4, 6, 10).
else:
self._sublabels = set(np.linspace(1, b, b))
# Label all integer multiples of base**n.
self._sublabels = set(np.arange(1, b + 1))

def __call__(self, x, pos=None):
"""
Expand Down