File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -425,7 +425,7 @@ def set_color(self, c):
425
425
426
426
def _set_hatchcolor (self , color ):
427
427
color = mpl ._val_or_rc (color , 'hatch.color' )
428
- if color == 'edge' :
428
+ if cbook . _str_equal ( color , 'edge' ) :
429
429
self ._hatch_color = 'edge'
430
430
else :
431
431
self ._hatch_color = colors .to_rgba (color , self ._alpha )
@@ -439,8 +439,6 @@ def set_hatchcolor(self, color):
439
439
----------
440
440
color : :mpltype:`color` or 'edge' or None
441
441
"""
442
- if cbook ._str_equal (color , 'edge' ):
443
- color = 'edge'
444
442
self ._original_hatchcolor = color
445
443
self ._set_hatchcolor (color )
446
444
Original file line number Diff line number Diff line change @@ -1023,6 +1023,9 @@ def test_patch_hatchcolor_inherit_logic():
1023
1023
rect .set_edgecolor ('green' )
1024
1024
assert mcolors .same_color (rect .get_hatchcolor (), 'purple' )
1025
1025
1026
+ # Smoke test for setting with numpy array
1027
+ rect .set_hatchcolor (np .ones (3 ))
1028
+
1026
1029
1027
1030
def test_patch_hatchcolor_fallback_logic ():
1028
1031
# Test for when hatchcolor parameter is passed
You can’t perform that action at this time.
0 commit comments