@@ -1390,63 +1390,63 @@ def test_collection_hatchcolor_inherit_logic():
13901390 from matplotlib .collections import PathCollection
13911391 path = mpath .Path .unit_rectangle ()
13921392
1393- colors_1 = ['purple' , 'red' , 'green' , 'yellow' ]
1394- colors_2 = ['orange' , 'cyan' , 'blue' , 'magenta' ]
1393+ edgecolors = ['purple' , 'red' , 'green' , 'yellow' ]
1394+ hatchcolors = ['orange' , 'cyan' , 'blue' , 'magenta' ]
13951395 with mpl .rc_context ({'hatch.color' : 'edge' }):
13961396 # edgecolor and hatchcolor is set
13971397 col = PathCollection ([path ], hatch = '//' ,
1398- edgecolor = colors_1 , hatchcolor = colors_2 )
1399- assert_array_equal (col .get_hatchcolor (), mpl .colors .to_rgba_array (colors_2 ))
1398+ edgecolor = edgecolors , hatchcolor = hatchcolors )
1399+ assert_array_equal (col .get_hatchcolor (), mpl .colors .to_rgba_array (hatchcolors ))
14001400
14011401 # explicitly setting edgecolor and then hatchcolor
14021402 col = PathCollection ([path ], hatch = '//' )
1403- col .set_edgecolor (colors_1 )
1404- assert_array_equal (col .get_hatchcolor (), mpl .colors .to_rgba_array (colors_1 ))
1405- col .set_hatchcolor (colors_2 )
1406- assert_array_equal (col .get_hatchcolor (), mpl .colors .to_rgba_array (colors_2 ))
1403+ col .set_edgecolor (edgecolors )
1404+ assert_array_equal (col .get_hatchcolor (), mpl .colors .to_rgba_array (edgecolors ))
1405+ col .set_hatchcolor (hatchcolors )
1406+ assert_array_equal (col .get_hatchcolor (), mpl .colors .to_rgba_array (hatchcolors ))
14071407
14081408 # explicitly setting hatchcolor and then edgecolor
14091409 col = PathCollection ([path ], hatch = '//' )
1410- col .set_hatchcolor (colors_1 )
1411- assert_array_equal (col .get_hatchcolor (), mpl .colors .to_rgba_array (colors_1 ))
1412- col .set_edgecolor (colors_2 )
1413- assert_array_equal (col .get_hatchcolor (), mpl .colors .to_rgba_array (colors_1 ))
1410+ col .set_hatchcolor (hatchcolors )
1411+ assert_array_equal (col .get_hatchcolor (), mpl .colors .to_rgba_array (hatchcolors ))
1412+ col .set_edgecolor (edgecolors )
1413+ assert_array_equal (col .get_hatchcolor (), mpl .colors .to_rgba_array (hatchcolors ))
14141414
14151415
14161416def test_collection_hatchcolor_fallback_logic ():
14171417 from matplotlib .collections import PathCollection
14181418 path = mpath .Path .unit_rectangle ()
14191419
1420- colors_1 = ['purple' , 'red' , 'green' , 'yellow' ]
1421- colors_2 = ['orange' , 'cyan' , 'blue' , 'magenta' ]
1420+ edgecolors = ['purple' , 'red' , 'green' , 'yellow' ]
1421+ hatchcolors = ['orange' , 'cyan' , 'blue' , 'magenta' ]
14221422
14231423 # hatchcolor parameter should take precedence over rcParam
14241424 # When edgecolor is not set
14251425 with mpl .rc_context ({'hatch.color' : 'green' }):
1426- col = PathCollection ([path ], hatch = '//' , hatchcolor = colors_1 )
1427- assert_array_equal (col .get_hatchcolor (), mpl .colors .to_rgba_array (colors_1 ))
1426+ col = PathCollection ([path ], hatch = '//' , hatchcolor = hatchcolors )
1427+ assert_array_equal (col .get_hatchcolor (), mpl .colors .to_rgba_array (hatchcolors ))
14281428 # When edgecolor is set
14291429 with mpl .rc_context ({'hatch.color' : 'green' }):
14301430 col = PathCollection ([path ], hatch = '//' ,
1431- edgecolor = colors_2 , hatchcolor = colors_1 )
1432- assert_array_equal (col .get_hatchcolor (), mpl .colors .to_rgba_array (colors_1 ))
1431+ edgecolor = edgecolors , hatchcolor = hatchcolors )
1432+ assert_array_equal (col .get_hatchcolor (), mpl .colors .to_rgba_array (hatchcolors ))
14331433
14341434 # hatchcolor should not be overridden by edgecolor when
14351435 # hatchcolor parameter is not passed and hatch.color rcParam is set to a color
14361436 with mpl .rc_context ({'hatch.color' : 'green' }):
14371437 col = PathCollection ([path ], hatch = '//' )
14381438 assert_array_equal (col .get_hatchcolor (), mpl .colors .to_rgba_array ('green' ))
1439- col .set_edgecolor (colors_1 )
1439+ col .set_edgecolor (edgecolors )
14401440 assert_array_equal (col .get_hatchcolor (), mpl .colors .to_rgba_array ('green' ))
14411441
14421442 # hatchcolor should match edgecolor when
14431443 # hatchcolor parameter is not passed and hatch.color rcParam is set to 'edge'
14441444 with mpl .rc_context ({'hatch.color' : 'edge' }):
1445- col = PathCollection ([path ], hatch = '//' , edgecolor = colors_1 )
1446- assert_array_equal (col .get_hatchcolor (), mpl .colors .to_rgba_array (colors_1 ))
1445+ col = PathCollection ([path ], hatch = '//' , edgecolor = edgecolors )
1446+ assert_array_equal (col .get_hatchcolor (), mpl .colors .to_rgba_array (edgecolors ))
14471447 # hatchcolor parameter is set to 'edge'
1448- col = PathCollection ([path ], hatch = '//' , edgecolor = colors_1 , hatchcolor = 'edge' )
1449- assert_array_equal (col .get_hatchcolor (), mpl .colors .to_rgba_array (colors_1 ))
1448+ col = PathCollection ([path ], hatch = '//' , edgecolor = edgecolors , hatchcolor = 'edge' )
1449+ assert_array_equal (col .get_hatchcolor (), mpl .colors .to_rgba_array (edgecolors ))
14501450
14511451 # default hatchcolor should be used when hatchcolor parameter is not passed and
14521452 # hatch.color rcParam is set to 'edge' and edgecolor is not set
0 commit comments