Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8266e76

Browse filesBrowse files
committed
MNT: move NoNorm logic up to be on same footing on BoundryNorm
1 parent 8d3d03a commit 8266e76
Copy full SHA for 8266e76

File tree

Expand file treeCollapse file tree

1 file changed

+6
-6
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-6
lines changed

‎lib/matplotlib/colorbar.py

Copy file name to clipboardExpand all lines: lib/matplotlib/colorbar.py
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,12 @@ def _get_ticker_locator_formatter(self):
824824
b = self.norm.boundaries
825825
if locator is None:
826826
locator = ticker.FixedLocator(b, nbins=10)
827+
elif isinstance(self.norm, colors.NoNorm):
828+
if locator is None:
829+
# put ticks on integers between the boundaries of NoNorm
830+
nv = len(self._values)
831+
base = 1 + int(nv / 10)
832+
locator = ticker.IndexLocator(base=base, offset=.5)
827833
elif self.boundaries is not None:
828834
b = self._boundaries[self._inside]
829835
if locator is None:
@@ -835,12 +841,6 @@ def _get_ticker_locator_formatter(self):
835841
locator = self._long_axis().get_major_locator()
836842
if minorlocator is None:
837843
minorlocator = self._long_axis().get_minor_locator()
838-
if isinstance(self.norm, colors.NoNorm):
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)
844844

845845
if minorlocator is None:
846846
minorlocator = ticker.NullLocator()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.