Skip to content

Commit

Permalink
Merge pull request #24938 from meeseeksmachine/auto-backport-of-pr-23…
Browse files Browse the repository at this point in the history
…390-on-v3.7.x

Backport PR #23390 on branch v3.7.x (FIX: colorbar contour with log norm should default to log locator and formatter...)
  • Loading branch information
QuLogic committed Jan 11, 2023
2 parents a6cf357 + a3a66a9 commit 1fb4d50
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 1fb4d50

Please sign in to comment.