88they are meant to be fast for common use cases (e.g. a bunch of solid
99line segemnts)
1010"""
11- import math , warnings
11+ import copy , math , warnings
1212import numpy as np
1313import numpy .ma as ma
1414import matplotlib as mpl
@@ -331,8 +331,8 @@ def set_facecolor(self, c):
331331 ACCEPTS: matplotlib color arg or sequence of rgba tuples
332332 """
333333 if c is None : c = mpl .rcParams ['patch.facecolor' ]
334- self ._facecolors = _colors .colorConverter .to_rgba_array (c , self ._alpha )
335334 self ._facecolors_original = c
335+ self ._facecolors = _colors .colorConverter .to_rgba_array (c , self ._alpha )
336336
337337 set_facecolors = set_facecolor
338338
@@ -361,10 +361,11 @@ def set_edgecolor(self, c):
361361 """
362362 if c == 'face' :
363363 self ._edgecolors = 'face'
364+ self ._edgecolors_original = 'face'
364365 else :
365366 if c is None : c = mpl .rcParams ['patch.edgecolor' ]
366- self ._edgecolors = _colors .colorConverter .to_rgba_array (c , self ._alpha )
367367 self ._edgecolors_original = c
368+ self ._edgecolors = _colors .colorConverter .to_rgba_array (c , self ._alpha )
368369
369370 set_edgecolors = set_edgecolor
370371
@@ -385,8 +386,9 @@ def set_alpha(self, alpha):
385386 except (AttributeError , TypeError , IndexError ):
386387 pass
387388 try :
388- self ._edgecolors = _colors .colorConverter .to_rgba_array (
389- self ._edgecolors_original , self ._alpha )
389+ if self ._edgecolors_original != 'face' :
390+ self ._edgecolors = _colors .colorConverter .to_rgba_array (
391+ self ._edgecolors_original , self ._alpha )
390392 except (AttributeError , TypeError , IndexError ):
391393 pass
392394
@@ -809,7 +811,7 @@ def __init__(self, segments, # Can be None.
809811 pickradius = pickradius ,
810812 ** kwargs )
811813
812- self ._facecolors = np . array ([])
814+ self .set_facecolors ([])
813815 self .set_segments (segments )
814816
815817 def get_paths (self ):
0 commit comments