Skip to content

Commit

Permalink
Don't clip colorbar dividers
Browse files Browse the repository at this point in the history
They are sometimes right on the edge of the Axes, and the last (or
possibly first) don't get drawn due to clipping. Because the divider
line width is the same as the Axes frame line width, we don't have to
worry about it going outside when unclipped.

Fixes #22864
  • Loading branch information
QuLogic committed Aug 4, 2022
1 parent 5d0d141 commit 298a23f
Show file tree
Hide file tree
Showing 5 changed files with 380 additions and 23 deletions.
3 changes: 2 additions & 1 deletion lib/matplotlib/colorbar.py
Expand Up @@ -434,7 +434,8 @@ def __init__(self, ax, mappable=None, *, cmap=None,
self.dividers = collections.LineCollection(
[],
colors=[mpl.rcParams['axes.edgecolor']],
linewidths=[0.5 * mpl.rcParams['axes.linewidth']])
linewidths=[0.5 * mpl.rcParams['axes.linewidth']],
clip_on=False)
self.ax.add_collection(self.dividers)

self._locator = None
Expand Down
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 298a23f

Please sign in to comment.