From c219323cf18cbe1a7b3670b1131d4a817d5a1f34 Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Wed, 7 Dec 2016 07:58:27 -1000 Subject: [PATCH] ticker: cast argument to int to avoid numpy warning --- lib/matplotlib/ticker.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/ticker.py b/lib/matplotlib/ticker.py index 754f2158159d..4df8689e9ccb 100644 --- a/lib/matplotlib/ticker.py +++ b/lib/matplotlib/ticker.py @@ -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): """