Skip to content

Commit

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

Backport PR #23390 on branch v3.6.x (FIX: colorbar contour with log norm should default to log locator and formatter...)
  • Loading branch information
QuLogic authored Jan 11, 2023
2 parents c8e25ef + 88a1537 commit 4f30cf4
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
Original file line number Diff line number Diff line change
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
Loading

0 comments on commit 4f30cf4

Please sign in to comment.