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