Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f82fc3b

Browse files
committed
Merge pull request #6375 from tacaswell/api_cb_default_locator
API: default locator on colorbars to AutoLocator
2 parents dc6f462 + 88f495b commit f82fc3b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/matplotlib/colorbar.py

Lines changed: 4 additions & 1 deletion
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)