1313
1414import numpy as np
1515
16- from . import artist , colors as mcolors , docstring , rcParams
16+ from . import artist , cbook , colors as mcolors , docstring , rcParams
1717from .artist import Artist , allow_rasterization
1818from .cbook import (
1919 _to_unmasked_float_array , iterable , is_numlike , ls_mapper , ls_mapper_r ,
@@ -792,16 +792,16 @@ def draw(self, renderer):
792792 rgbaFace = self ._get_rgba_face ()
793793 rgbaFaceAlt = self ._get_rgba_face (alt = True )
794794 edgecolor = self .get_markeredgecolor ()
795- if (isinstance (edgecolor , six .string_types )
796- and edgecolor .lower () == 'none' ):
795+ if cbook ._str_lower_equal (edgecolor , "none" ):
797796 gc .set_linewidth (0 )
798797 gc .set_foreground (rgbaFace , isRGBA = True )
799798 else :
800799 gc .set_foreground (edgecolor )
801800 gc .set_linewidth (self ._markeredgewidth )
802801 mec = self ._markeredgecolor
803- if (isinstance (mec , six .string_types ) and mec == 'auto' and
804- rgbaFace is not None ):
802+ if (cbook ._str_equal (mec , "auto" )
803+ and not cbook ._str_lower_equal (
804+ self .get_markerfacecolor (), "none" )):
805805 gc .set_alpha (rgbaFace [3 ])
806806 else :
807807 gc .set_alpha (self .get_alpha ())
@@ -827,8 +827,7 @@ def draw(self, renderer):
827827 marker_trans = marker .get_transform ()
828828 w = renderer .points_to_pixels (self ._markersize )
829829
830- if (isinstance (marker .get_marker (), six .string_types ) and
831- marker .get_marker () == ',' ):
830+ if cbook ._str_equal (marker .get_marker (), "," ):
832831 gc .set_linewidth (0 )
833832 else :
834833 # Don't scale for pixels, and don't stroke them
@@ -842,8 +841,9 @@ def draw(self, renderer):
842841 if alt_marker_path :
843842 alt_marker_trans = marker .get_alt_transform ()
844843 alt_marker_trans = alt_marker_trans .scale (w )
845- if (isinstance (mec , six .string_types ) and mec == 'auto' and
846- rgbaFaceAlt is not None ):
844+ if (cbook ._str_equal (mec , "auto" )
845+ and not cbook ._str_lower_equal (
846+ self .get_markerfacecoloralt (), "none" )):
847847 gc .set_alpha (rgbaFaceAlt [3 ])
848848 else :
849849 gc .set_alpha (self .get_alpha ())
@@ -1260,13 +1260,7 @@ def update_from(self, other):
12601260 self ._drawstyle = other ._drawstyle
12611261
12621262 def _get_rgba_face (self , alt = False ):
1263- facecolor = self ._get_markerfacecolor (alt = alt )
1264- if (isinstance (facecolor , six .string_types )
1265- and facecolor .lower () == 'none' ):
1266- rgbaFace = None
1267- else :
1268- rgbaFace = mcolors .to_rgba (facecolor , self ._alpha )
1269- return rgbaFace
1263+ return mcolors .to_rgba (self ._get_markerfacecolor (alt = alt ), self ._alpha )
12701264
12711265 def _get_rgba_ln_color (self , alt = False ):
12721266 return mcolors .to_rgba (self ._color , self ._alpha )
0 commit comments