From b38c8167aac126f0623eb0e909b68aec297b2d75 Mon Sep 17 00:00:00 2001 From: "Nicolas P. Rougier" Date: Sat, 17 Sep 2016 08:51:49 +0200 Subject: [PATCH] Fix MultipleLocator proposed by @anntzer --- lib/matplotlib/ticker.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/ticker.py b/lib/matplotlib/ticker.py index 84192c7b9e26..2bd27db49050 100644 --- a/lib/matplotlib/ticker.py +++ b/lib/matplotlib/ticker.py @@ -1614,10 +1614,10 @@ def __call__(self): def tick_values(self, vmin, vmax): if vmax < vmin: vmin, vmax = vmax, vmin - vmin = self._base.ge(vmin) base = self._base.get_base() - n = (vmax - vmin + 0.001 * base) // base - locs = vmin - base + np.arange(n + 3) * base + nmin = round(self._base.ge(vmin) / base) + nmax = round(self._base.le(vmax) / base) + locs = np.arange(nmin, nmax + 1) * base return self.raise_if_exceeds(locs) def view_limits(self, dmin, dmax):