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 7867fc3

Browse filesBrowse files
committed
FIX
1 parent b54d8b8 commit 7867fc3
Copy full SHA for 7867fc3

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+6
-2
lines changed

‎lib/matplotlib/colorbar.py

Copy file name to clipboardExpand all lines: lib/matplotlib/colorbar.py
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,15 +1024,19 @@ def _reset_locator_formatter_scale(self):
10241024
self.__scale = 'linear'
10251025
self.ax.set_xscale('linear')
10261026
self.ax.set_yscale('linear')
1027-
elif hasattr(self.norm, '_scale') and (self.norm._scale is not None):
1027+
elif hasattr(self.norm, '_scale') and self.norm._scale is not None:
1028+
# use the norm's scale:
10281029
self.ax.set_xscale(self.norm._scale)
10291030
self.ax.set_yscale(self.norm._scale)
10301031
self.__scale = self.norm._scale.name
10311032
elif type(self.norm) is colors.Normalize:
1032-
self.__scale = 'linear'
1033+
# plain Normalize:
10331034
self.ax.set_xscale('linear')
10341035
self.ax.set_yscale('linear')
1036+
self.__scale = 'linear'
10351037
else:
1038+
# norm._scale is None or not an attr: derive the scale from
1039+
# the Norm:
10361040
funcs = (self._forward_from_norm, self._inverse_from_norm)
10371041
self.ax.set_xscale('function', functions=funcs)
10381042
self.ax.set_yscale('function', functions=funcs)

0 commit comments

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