Skip to content

Commit 7f4522e

Browse files
committed
FIX: make colorbars for log normed contour plots have logscale
1 parent 79b7f25 commit 7f4522e

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
@@ -1212,7 +1212,11 @@ def _reset_locator_formatter_scale(self):
12121212
self._minorlocator = None
12131213
self._formatter = None
12141214
self._minorformatter = None
1215-
if (self.boundaries is not None or
1215+
if (isinstance(self.mappable, contour.ContourSet) and
1216+
isinstance(self.norm, colors.LogNorm)):
1217+
# if contours have lognorm, give them a log scale...
1218+
self._set_scale('log')
1219+
elif (self.boundaries is not None or
12161220
isinstance(self.norm, colors.BoundaryNorm)):
12171221
if self.spacing == 'uniform':
12181222
funcs = (self._forward_boundaries, self._inverse_boundaries)

0 commit comments

Comments
 (0)