Skip to content

Commit

Permalink
Backport PR matplotlib#23390: FIX: colorbar contour with log norm sho…
Browse files Browse the repository at this point in the history
…uld default to log locator and formatter...
  • Loading branch information
QuLogic authored and meeseeksmachine committed Jan 11, 2023
1 parent 65044a2 commit 88a1537
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 @@ -1167,7 +1167,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 88a1537

Please sign in to comment.