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):