Skip to content

Commit

Permalink
Merge pull request #23390 from jklymak/fix-colorbar-contour-log
Browse files Browse the repository at this point in the history
FIX: colorbar contour with log norm should default to log locator and formatter...
  • Loading branch information
QuLogic committed Jan 11, 2023
2 parents a483e85 + c06f3bd commit 1bb68a8
Show file tree
Hide file tree
Showing 3 changed files with 3,403 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/matplotlib/colorbar.py
Expand Up @@ -1179,7 +1179,11 @@ def _reset_locator_formatter_scale(self):
self._minorlocator = None
self._formatter = None
self._minorformatter = None
if (self.boundaries is not None or
if (isinstance(self.mappable, contour.ContourSet) and
isinstance(self.norm, colors.LogNorm)):
# if contours have lognorm, give them a log scale...
self._set_scale('log')
elif (self.boundaries is not None or
isinstance(self.norm, colors.BoundaryNorm)):
if self.spacing == 'uniform':
funcs = (self._forward_boundaries, self._inverse_boundaries)
Expand Down

0 comments on commit 1bb68a8

Please sign in to comment.