diff --git a/lib/matplotlib/colorbar.py b/lib/matplotlib/colorbar.py index ad6a145a9d12..cc46385569d2 100644 --- a/lib/matplotlib/colorbar.py +++ b/lib/matplotlib/colorbar.py @@ -576,7 +576,10 @@ def _ticker(self): elif isinstance(self.norm, colors.LogNorm): locator = ticker.LogLocator() else: - locator = ticker.MaxNLocator() + if mpl.rcParams['_internal.classic_mode']: + locator = ticker.MaxNLocator() + else: + locator = ticker.AutoLocator() else: b = self._boundaries[self._inside] locator = ticker.FixedLocator(b, nbins=10)