Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
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
remove _orig_color which is duplicate of _rgb
  • Loading branch information
jbmohler committed Oct 20, 2014
commit c22584ebed1d69ee8844937c3ea822c87d687211
10 changes: 4 additions & 6 deletions lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,6 @@ def __init__(self):
self._linestyle = 'solid'
self._linewidth = 1
self._rgb = (0.0, 0.0, 0.0, 1.0)
self._orig_color = (0.0, 0.0, 0.0, 1.0)
self._hatch = None
self._url = None
self._gid = None
Expand All @@ -803,7 +802,6 @@ def copy_properties(self, gc):
self._linestyle = gc._linestyle
self._linewidth = gc._linewidth
self._rgb = gc._rgb
self._orig_color = gc._orig_color
self._hatch = gc._hatch
self._url = gc._url
self._gid = gc._gid
Expand Down Expand Up @@ -937,7 +935,7 @@ def set_alpha(self, alpha):
else:
self._alpha = 1.0
self._forced_alpha = False
self.set_foreground(self._orig_color)
self.set_foreground(self._rgb, isRGBA=True)

def set_antialiased(self, b):
"""
Expand Down Expand Up @@ -999,8 +997,9 @@ def set_foreground(self, fg, isRGBA=False):

If you know fg is rgba, set ``isRGBA=True`` for efficiency.
"""
self._orig_color = fg
if self._forced_alpha:
if self._forced_alpha and isRGBA:
self._rgb = fg[:3] + (self._alpha,)
elif self._forced_alpha:
self._rgb = colors.colorConverter.to_rgba(fg, self._alpha)
elif isRGBA:
self._rgb = fg
Expand All @@ -1011,7 +1010,6 @@ def set_graylevel(self, frac):
"""
Set the foreground color to be a gray level with *frac*
"""
self._orig_color = frac
self._rgb = (frac, frac, frac, self._alpha)

def set_joinstyle(self, js):
Expand Down