13
13
14
14
import numpy as np
15
15
16
- from . import artist , colors as mcolors , docstring , rcParams
16
+ from . import artist , cbook , colors as mcolors , docstring , rcParams
17
17
from .artist import Artist , allow_rasterization
18
18
from .cbook import (
19
19
_to_unmasked_float_array , iterable , is_numlike , ls_mapper , ls_mapper_r ,
@@ -792,16 +792,16 @@ def draw(self, renderer):
792
792
rgbaFace = self ._get_rgba_face ()
793
793
rgbaFaceAlt = self ._get_rgba_face (alt = True )
794
794
edgecolor = self .get_markeredgecolor ()
795
- if (isinstance (edgecolor , six .string_types )
796
- and edgecolor .lower () == 'none' ):
795
+ if cbook ._str_lower_equal (edgecolor , "none" ):
797
796
gc .set_linewidth (0 )
798
797
gc .set_foreground (rgbaFace , isRGBA = True )
799
798
else :
800
799
gc .set_foreground (edgecolor )
801
800
gc .set_linewidth (self ._markeredgewidth )
802
801
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" )):
805
805
gc .set_alpha (rgbaFace [3 ])
806
806
else :
807
807
gc .set_alpha (self .get_alpha ())
@@ -827,8 +827,7 @@ def draw(self, renderer):
827
827
marker_trans = marker .get_transform ()
828
828
w = renderer .points_to_pixels (self ._markersize )
829
829
830
- if (isinstance (marker .get_marker (), six .string_types ) and
831
- marker .get_marker () == ',' ):
830
+ if cbook ._str_equal (marker .get_marker (), "," ):
832
831
gc .set_linewidth (0 )
833
832
else :
834
833
# Don't scale for pixels, and don't stroke them
@@ -842,8 +841,9 @@ def draw(self, renderer):
842
841
if alt_marker_path :
843
842
alt_marker_trans = marker .get_alt_transform ()
844
843
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" )):
847
847
gc .set_alpha (rgbaFaceAlt [3 ])
848
848
else :
849
849
gc .set_alpha (self .get_alpha ())
@@ -1260,13 +1260,7 @@ def update_from(self, other):
1260
1260
self ._drawstyle = other ._drawstyle
1261
1261
1262
1262
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 )
1270
1264
1271
1265
def _get_rgba_ln_color (self , alt = False ):
1272
1266
return mcolors .to_rgba (self ._color , self ._alpha )
0 commit comments