Skip to content

Commit a3a66a9

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

File tree

3 files changed

+3403
-2
lines changed

3 files changed

+3403
-2
lines changed

lib/matplotlib/colorbar.py

+5-1
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)