Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colorbar Add kw arguement to colorbar to reenable edges around faces #1301

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 14 additions & 2 deletions lib/matplotlib/colorbar.py
Expand Up @@ -97,7 +97,13 @@
:class:`~matplotlib.ticker.Formatter` object may be
given instead.
*drawedges* [ False | True ] If true, draw lines at color
boundaries.
boundaries
*drawfcedges* [ False | True ] If true, draw face-colored edges around
color segments. This helps with viewers that render
white lines between faces in the colorbar, however it
has negative consequences when ploting with alpha < 1
or colorbar extensions and is thus not enabled by default.
See github issue #1178 and #1188.
============ ====================================================

The following will probably be useful only in the context of
Expand Down Expand Up @@ -243,6 +249,7 @@ def __init__(self, ax, cmap=None,
ticks=None,
format=None,
drawedges=False,
drawfcedges=False,
filled=True,
extendfrac=None,
):
Expand All @@ -259,6 +266,7 @@ def __init__(self, ax, cmap=None,
self.spacing = spacing
self.orientation = orientation
self.drawedges = drawedges
self.drawfcedges = drawfcedges
self.filled = filled
self.extendfrac = extendfrac
self.solids = None
Expand Down Expand Up @@ -447,10 +455,14 @@ def _add_solids(self, X, Y, C):
args = (X, Y, C)
else:
args = (np.transpose(Y), np.transpose(X), np.transpose(C))
if self.drawfcedges == True:
edgecolors = 'face'
else:
edgecolors = 'None'
kw = dict(cmap=self.cmap,
norm=self.norm,
alpha=self.alpha,
edgecolors='None')
edgecolors=edgecolors)
# Save, set, and restore hold state to keep pcolor from
# clearing the axes. Ordinarily this will not be needed,
# since the axes object should already have hold set.
Expand Down