Skip to content

Commit c06f3bd

Browse files
committed
FIX: make colorbars for log normed contour plots have logscale
1 parent 8e9f5ec commit c06f3bd

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
@@ -1180,7 +1180,11 @@ def _reset_locator_formatter_scale(self):
11801180
self._minorlocator = None
11811181
self._formatter = None
11821182
self._minorformatter = None
1183-
if (self.boundaries is not None or
1183+
if (isinstance(self.mappable, contour.ContourSet) and
1184+
isinstance(self.norm, colors.LogNorm)):
1185+
# if contours have lognorm, give them a log scale...
1186+
self._set_scale('log')
1187+
elif (self.boundaries is not None or
11841188
isinstance(self.norm, colors.BoundaryNorm)):
11851189
if self.spacing == 'uniform':
11861190
funcs = (self._forward_boundaries, self._inverse_boundaries)

0 commit comments

Comments
 (0)