@@ -757,9 +757,8 @@ def draw(self, renderer):
757
757
gc = renderer .new_gc ()
758
758
self ._set_gc_clip (gc )
759
759
760
- ln_color_rgba = self ._get_rgba_ln_color ()
761
- gc .set_foreground (ln_color_rgba , isRGBA = True )
762
- gc .set_alpha (ln_color_rgba [3 ])
760
+ lc_rgba = mcolors .to_rgba (self ._color , self ._alpha )
761
+ gc .set_foreground (lc_rgba , isRGBA = True )
763
762
764
763
gc .set_antialiased (self ._antialiased )
765
764
gc .set_linewidth (self ._linewidth )
@@ -783,24 +782,23 @@ def draw(self, renderer):
783
782
if self ._marker and self ._markersize > 0 :
784
783
gc = renderer .new_gc ()
785
784
self ._set_gc_clip (gc )
786
- rgbaFace = self ._get_rgba_face ()
787
- rgbaFaceAlt = self ._get_rgba_face (alt = True )
788
- edgecolor = self .get_markeredgecolor ()
789
- if cbook ._str_lower_equal (edgecolor , "none" ):
790
- gc .set_linewidth (0 )
791
- gc .set_foreground (rgbaFace , isRGBA = True )
792
- else :
793
- gc .set_foreground (edgecolor )
794
- gc .set_linewidth (self ._markeredgewidth )
795
- mec = self ._markeredgecolor
796
- if (cbook ._str_equal (mec , "auto" )
797
- and not cbook ._str_lower_equal (
798
- self .get_markerfacecolor (), "none" )):
799
- gc .set_alpha (rgbaFace [3 ])
800
- else :
801
- gc .set_alpha (self .get_alpha ())
785
+ gc .set_linewidth (self ._markeredgewidth )
802
786
gc .set_antialiased (self ._antialiased )
803
787
788
+ ec_rgba = mcolors .to_rgba (
789
+ self .get_markeredgecolor (), self ._alpha )
790
+ fc_rgba = mcolors .to_rgba (
791
+ self ._get_markerfacecolor (), self ._alpha )
792
+ fcalt_rgba = mcolors .to_rgba (
793
+ self ._get_markerfacecolor (alt = True ), self ._alpha )
794
+ # If the edgecolor is "auto", it is set according to the *line*
795
+ # color but inherits the alpha value of the *face* color, if any.
796
+ if (cbook ._str_equal (self ._markeredgecolor , "auto" )
797
+ and not cbook ._str_lower_equal (
798
+ self .get_markerfacecolor (), "none" )):
799
+ ec_rgba = ec_rgba [:3 ] + (fc_rgba [3 ],)
800
+ gc .set_foreground (ec_rgba , isRGBA = True )
801
+
804
802
marker = self ._marker
805
803
tpath , affine = transf_path .get_transformed_points_and_affine ()
806
804
if len (tpath .vertices ):
@@ -830,22 +828,15 @@ def draw(self, renderer):
830
828
831
829
renderer .draw_markers (gc , marker_path , marker_trans ,
832
830
subsampled , affine .frozen (),
833
- rgbaFace )
831
+ fc_rgba )
834
832
835
833
alt_marker_path = marker .get_alt_path ()
836
834
if alt_marker_path :
837
835
alt_marker_trans = marker .get_alt_transform ()
838
836
alt_marker_trans = alt_marker_trans .scale (w )
839
- if (cbook ._str_equal (mec , "auto" )
840
- and not cbook ._str_lower_equal (
841
- self .get_markerfacecoloralt (), "none" )):
842
- gc .set_alpha (rgbaFaceAlt [3 ])
843
- else :
844
- gc .set_alpha (self .get_alpha ())
845
-
846
837
renderer .draw_markers (
847
838
gc , alt_marker_path , alt_marker_trans , subsampled ,
848
- affine .frozen (), rgbaFaceAlt )
839
+ affine .frozen (), fcalt_rgba )
849
840
850
841
gc .restore ()
851
842
@@ -890,8 +881,7 @@ def _get_markerfacecolor(self, alt=False):
890
881
fc = self ._markerfacecoloralt
891
882
else :
892
883
fc = self ._markerfacecolor
893
-
894
- if (isinstance (fc , six .string_types ) and fc .lower () == 'auto' ):
884
+ if cbook ._str_lower_equal (fc , 'auto' ):
895
885
if self .get_fillstyle () == 'none' :
896
886
return 'none'
897
887
else :
@@ -1251,9 +1241,6 @@ def update_from(self, other):
1251
1241
def _get_rgba_face (self , alt = False ):
1252
1242
return mcolors .to_rgba (self ._get_markerfacecolor (alt = alt ), self ._alpha )
1253
1243
1254
- def _get_rgba_ln_color (self , alt = False ):
1255
- return mcolors .to_rgba (self ._color , self ._alpha )
1256
-
1257
1244
def set_dash_joinstyle (self , s ):
1258
1245
"""
1259
1246
Set the join style for dashed linestyles
0 commit comments