Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 866493b commit 00a10efCopy full SHA for 00a10ef
lib/matplotlib/colorbar.py
@@ -839,6 +839,7 @@ def _get_ticker_locator_formatter(self):
839
# default locator:
840
nv = len(self._values)
841
base = 1 + int(nv / 10)
842
+ # put ticks on integers between the boundaries of NoNorm...
843
locator = ticker.IndexLocator(base=base, offset=.5)
844
845
if minorlocator is None:
@@ -1098,6 +1099,7 @@ def _process_values(self):
1098
1099
if isinstance(self.norm, colors.BoundaryNorm):
1100
b = self.norm.boundaries
1101
elif isinstance(self.norm, colors.NoNorm):
1102
+ # NoNorm has N blocks, so N+1 boundaries, cantered on integers:
1103
b = np.arange(self.cmap.N + 1) - .5
1104
else:
1105
# otherwise make the boundaries from the size of the cmap:
0 commit comments