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 1bb68a8

Browse filesBrowse files
authored
Merge pull request #23390 from jklymak/fix-colorbar-contour-log
FIX: colorbar contour with log norm should default to log locator and formatter...
2 parents a483e85 + c06f3bd commit 1bb68a8
Copy full SHA for 1bb68a8

File tree

Expand file treeCollapse file tree

3 files changed

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

3 files changed

+3403
-2
lines changed

‎lib/matplotlib/colorbar.py

Copy file name to clipboardExpand all lines: lib/matplotlib/colorbar.py
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,11 @@ def _reset_locator_formatter_scale(self):
11791179
self._minorlocator = None
11801180
self._formatter = None
11811181
self._minorformatter = None
1182-
if (self.boundaries is not None or
1182+
if (isinstance(self.mappable, contour.ContourSet) and
1183+
isinstance(self.norm, colors.LogNorm)):
1184+
# if contours have lognorm, give them a log scale...
1185+
self._set_scale('log')
1186+
elif (self.boundaries is not None or
11831187
isinstance(self.norm, colors.BoundaryNorm)):
11841188
if self.spacing == 'uniform':
11851189
funcs = (self._forward_boundaries, self._inverse_boundaries)

0 commit comments

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