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

Skip to content

Commit 00a10ef

Browse files
tacaswelljklymak
andauthored
Apply suggestions from code review
I am going to squash these. Co-authored-by: Jody Klymak <[email protected]>
1 parent 866493b commit 00a10ef

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/matplotlib/colorbar.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,7 @@ def _get_ticker_locator_formatter(self):
839839
# default locator:
840840
nv = len(self._values)
841841
base = 1 + int(nv / 10)
842+
# put ticks on integers between the boundaries of NoNorm...
842843
locator = ticker.IndexLocator(base=base, offset=.5)
843844

844845
if minorlocator is None:
@@ -1098,6 +1099,7 @@ def _process_values(self):
10981099
if isinstance(self.norm, colors.BoundaryNorm):
10991100
b = self.norm.boundaries
11001101
elif isinstance(self.norm, colors.NoNorm):
1102+
# NoNorm has N blocks, so N+1 boundaries, cantered on integers:
11011103
b = np.arange(self.cmap.N + 1) - .5
11021104
else:
11031105
# otherwise make the boundaries from the size of the cmap:

0 commit comments

Comments
 (0)