@@ -759,9 +759,8 @@ def draw(self, renderer):
759759 gc = renderer .new_gc ()
760760 self ._set_gc_clip (gc )
761761
762- ln_color_rgba = self ._get_rgba_ln_color ()
763- gc .set_foreground (ln_color_rgba , isRGBA = True )
764- gc .set_alpha (ln_color_rgba [3 ])
762+ lc_rgba = mcolors .to_rgba (self ._color , self ._alpha )
763+ gc .set_foreground (lc_rgba , isRGBA = True )
765764
766765 gc .set_antialiased (self ._antialiased )
767766 gc .set_linewidth (self ._linewidth )
@@ -785,24 +784,23 @@ def draw(self, renderer):
785784 if self ._marker and self ._markersize > 0 :
786785 gc = renderer .new_gc ()
787786 self ._set_gc_clip (gc )
788- rgbaFace = self ._get_rgba_face ()
789- rgbaFaceAlt = self ._get_rgba_face (alt = True )
790- edgecolor = self .get_markeredgecolor ()
791- if cbook ._str_lower_equal (edgecolor , "none" ):
792- gc .set_linewidth (0 )
793- gc .set_foreground (rgbaFace , isRGBA = True )
794- else :
795- gc .set_foreground (edgecolor )
796- gc .set_linewidth (self ._markeredgewidth )
797- mec = self ._markeredgecolor
798- if (cbook ._str_equal (mec , "auto" )
799- and not cbook ._str_lower_equal (
800- self .get_markerfacecolor (), "none" )):
801- gc .set_alpha (rgbaFace [3 ])
802- else :
803- gc .set_alpha (self .get_alpha ())
787+ gc .set_linewidth (self ._markeredgewidth )
804788 gc .set_antialiased (self ._antialiased )
805789
790+ ec_rgba = mcolors .to_rgba (
791+ self .get_markeredgecolor (), self ._alpha )
792+ fc_rgba = mcolors .to_rgba (
793+ self ._get_markerfacecolor (), self ._alpha )
794+ fcalt_rgba = mcolors .to_rgba (
795+ self ._get_markerfacecolor (alt = True ), self ._alpha )
796+ # If the edgecolor is "auto", it is set according to the *line*
797+ # color but inherits the alpha value of the *face* color, if any.
798+ if (cbook ._str_equal (self ._markeredgecolor , "auto" )
799+ and not cbook ._str_lower_equal (
800+ self .get_markerfacecolor (), "none" )):
801+ ec_rgba = ec_rgba [:3 ] + (fc_rgba [3 ],)
802+ gc .set_foreground (ec_rgba , isRGBA = True )
803+
806804 marker = self ._marker
807805 tpath , affine = transf_path .get_transformed_points_and_affine ()
808806 if len (tpath .vertices ):
@@ -832,22 +830,15 @@ def draw(self, renderer):
832830
833831 renderer .draw_markers (gc , marker_path , marker_trans ,
834832 subsampled , affine .frozen (),
835- rgbaFace )
833+ fc_rgba )
836834
837835 alt_marker_path = marker .get_alt_path ()
838836 if alt_marker_path :
839837 alt_marker_trans = marker .get_alt_transform ()
840838 alt_marker_trans = alt_marker_trans .scale (w )
841- if (cbook ._str_equal (mec , "auto" )
842- and not cbook ._str_lower_equal (
843- self .get_markerfacecoloralt (), "none" )):
844- gc .set_alpha (rgbaFaceAlt [3 ])
845- else :
846- gc .set_alpha (self .get_alpha ())
847-
848839 renderer .draw_markers (
849840 gc , alt_marker_path , alt_marker_trans , subsampled ,
850- affine .frozen (), rgbaFaceAlt )
841+ affine .frozen (), fcalt_rgba )
851842
852843 gc .restore ()
853844
@@ -892,8 +883,7 @@ def _get_markerfacecolor(self, alt=False):
892883 fc = self ._markerfacecoloralt
893884 else :
894885 fc = self ._markerfacecolor
895-
896- if (isinstance (fc , six .string_types ) and fc .lower () == 'auto' ):
886+ if cbook ._str_lower_equal (fc , 'auto' ):
897887 if self .get_fillstyle () == 'none' :
898888 return 'none'
899889 else :
@@ -1253,9 +1243,6 @@ def update_from(self, other):
12531243 def _get_rgba_face (self , alt = False ):
12541244 return mcolors .to_rgba (self ._get_markerfacecolor (alt = alt ), self ._alpha )
12551245
1256- def _get_rgba_ln_color (self , alt = False ):
1257- return mcolors .to_rgba (self ._color , self ._alpha )
1258-
12591246 def set_dash_joinstyle (self , s ):
12601247 """
12611248 Set the join style for dashed linestyles
0 commit comments