8000 Backport PR #23390: FIX: colorbar contour with log norm should defaul… · matplotlib/matplotlib@88a1537 · GitHub
[go: up one dir, main page]

Skip to content

Commit 88a1537

Browse files
QuLogicmeeseeksmachine
authored andcommitted
Backport PR #23390: FIX: colorbar contour with log norm should default to log locator and formatter...
1 parent 65044a2 commit 88a1537

File tree

3 files changed

+3403
-2
lines changed

3 files changed

+3403
-2
lines changed

lib/matplotlib/colorbar.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1167,7 +1167,11 @@ def _reset_locator_formatter_scale(self):
11671167
self._minorlocator = None
11681168
self._formatter = None
11691169
self._minorformatter = None
1170-
if (self.boundaries is not None or
1170+
if (isinstance(self.mappable, contour.ContourSet) and
1171+
isinstance(self.norm, colors.LogNorm)):
1172+
# if contours have lognorm, give them a log scale...
1173+
self._set_scale('log')
1174+
elif (self.boundaries is not None or
11711175
isinstance(self.norm, colors.BoundaryNorm)):
11721176
if self.spacing == 'uniform':
11731177
funcs = (self._forward_boundaries, self._inverse_boundaries)

0 commit comments

Comments
 (0)
0