@@ -759,9 +759,8 @@ def draw(self, renderer):
759
759
gc = renderer .new_gc ()
760
760
self ._set_gc_clip (gc )
761
761
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 )
765
764
766
765
gc .set_antialiased (self ._antialiased )
767
766
gc .set_linewidth (self ._linewidth )
@@ -785,24 +784,23 @@ def draw(self, renderer):
785
784
if self ._marker and self ._markersize > 0 :
786
785
gc = renderer .new_gc ()
787
786
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 )
804
788
gc .set_antialiased (self ._antialiased )
805
789
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
+
806
804
marker = self ._marker
807
805
tpath , affine = transf_path .get_transformed_points_and_affine ()
808
806
if len (tpath .vertices ):
@@ -832,22 +830,15 @@ def draw(self, renderer):
832
830
833
831
renderer .draw_markers (gc , marker_path , marker_trans ,
834
832
subsampled , affine .frozen (),
835
- rgbaFace )
833
+ fc_rgba )
836
834
837
835
alt_marker_path = marker .get_alt_path ()
838
836
if alt_marker_path :
839
837
alt_marker_trans = marker .get_alt_transform ()
840
838
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
-
848
839
renderer .draw_markers (
849
840
gc , alt_marker_path , alt_marker_trans , subsampled ,
850
- affine .frozen (), rgbaFaceAlt )
841
+ affine .frozen (), fcalt_rgba )
851
842
852
843
gc .restore ()
853
844
@@ -892,8 +883,7 @@ def _get_markerfacecolor(self, alt=False):
892
883
fc = self ._markerfacecoloralt
893
884
else :
894
885
fc = self ._markerfacecolor
895
-
896
- if (isinstance (fc , six .string_types ) and fc .lower () == 'auto' ):
886
+ if cbook ._str_lower_equal (fc , 'auto' ):
897
887
if self .get_fillstyle () == 'none' :
898
888
return 'none'
899
889
else :
@@ -1253,9 +1243,6 @@ def update_from(self, other):
1253
1243
def _get_rgba_face (self , alt = False ):
1254
1244
return mcolors .to_rgba (self ._get_markerfacecolor (alt = alt ), self ._alpha )
1255
1245
1256
- def _get_rgba_ln_color (self , alt = False ):
1257
- return mcolors .to_rgba (self ._color , self ._alpha )
1258
-
1259
1246
def set_dash_joinstyle (self , s ):
1260
1247
"""
1261
1248
Set the join style for dashed linestyles
0 commit comments