Skip to content

Use edgecolor rather than linewidth to control edge display. #6904

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

Merged
merged 3 commits into from
Aug 22, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix some test failures
  • Loading branch information
efiring committed Aug 5, 2016
commit 4ab8e14a318289d4603b005fa0f31cd2c281408c
12 changes: 6 additions & 6 deletions lib/matplotlib/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,12 @@ def get_edgecolor(self):
get_edgecolors = get_edgecolor

def _set_edgecolor(self, c):
if c is None:
if (mpl.rcParams['patch.force_edgecolor'] or
not self._is_filled or self._edge_default):
c = mpl.rcParams['patch.edgecolor']
else:
c = 'none'
self._is_stroked = True
try:
if c.lower() == 'none':
Expand Down Expand Up @@ -715,12 +721,6 @@ def set_edgecolor(self, c):
ACCEPTS: matplotlib color spec or sequence of specs
"""
self._original_edgecolor = c
if c is None:
if (mpl.rcParams['patch.force_edgecolor'] or
not self._is_filled or self._edge_default):
c = mpl.rcParams['patch.edgecolor']
else:
c = 'none'
self._set_edgecolor(c)

def set_edgecolors(self, c):
Expand Down
10 changes: 4 additions & 6 deletions lib/matplotlib/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,13 @@ def set_edgecolor(self, color):
self._original_edgecolor = color
self._set_edgecolor(color)


def set_ec(self, color):
"""alias for set_edgecolor"""
return self.set_edgecolor(color)

def _set_facecolor(self, color):
if color is None:
color = mpl.rcParams['patch.facecolor']
alpha = self._alpha if self._fill else 0
self._facecolor = colors.to_rgba(color, alpha)
self.stale = True
Expand All @@ -320,9 +321,7 @@ def set_facecolor(self, color):

ACCEPTS: mpl color spec, or None for default, or 'none' for no color
"""
self._original_facecolor = color # Not strictly needed now.
if color is None:
color = mpl.rcParams['patch.facecolor']
self._original_facecolor = color
self._set_facecolor(color)

def set_fc(self, color):
Expand Down Expand Up @@ -359,7 +358,6 @@ def set_alpha(self, alpha):
self._set_edgecolor(self._original_edgecolor)
# stale is already True


def set_linewidth(self, w):
"""
Set the patch linewidth in points
Expand Down Expand Up @@ -435,7 +433,7 @@ def set_fill(self, b):
ACCEPTS: [True | False]
"""
self._fill = bool(b)
self._set_facecolor(self._facecolor)
self._set_facecolor(self._original_facecolor)
self._set_edgecolor(self._original_edgecolor)
self.stale = True

Expand Down