Skip to content

Commit 88f495b

Browse files
committed
API: default locator on colorbars to AutoLocator
This brings them inline with the default locator on the x and y axis. Noted in https://stackoverflow.com/questions/37053874/
1 parent a38e1da commit 88f495b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/matplotlib/colorbar.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,10 @@ def _ticker(self):
576576
elif isinstance(self.norm, colors.LogNorm):
577577
locator = ticker.LogLocator()
578578
else:
579-
locator = ticker.MaxNLocator()
579+
if mpl.rcParams['_internal.classic_mode']:
580+
locator = ticker.MaxNLocator()
581+
else:
582+
locator = ticker.AutoLocator()
580583
else:
581584
b = self._boundaries[self._inside]
582585
locator = ticker.FixedLocator(b, nbins=10)

0 commit comments

Comments
 (0)