@@ -601,22 +601,26 @@ def test_patch_modification():
601
601
@check_figures_equal (extensions = ['png' ])
602
602
def test_patch_collection_modification (fig_test , fig_ref ):
603
603
# Test that modifying Patch3DCollection properties after creation works.
604
- patch = Circle ((0 , 0 ), 0.05 )
605
- c = art3d .Patch3DCollection ([patch ], linewidths = 3 )
604
+ patch1 = Circle ((0 , 0 ), 0.05 )
605
+ patch2 = Circle ((0.1 , 0.1 ), 0.03 )
606
+ facecolors = np .array ([[0. , 0.5 , 0. , 1. ], [0.5 , 0. , 0. , 0.5 ]])
607
+ c = art3d .Patch3DCollection ([patch1 , patch2 ], linewidths = 3 )
606
608
607
609
ax_test = fig_test .add_subplot (projection = '3d' )
608
610
ax_test .add_collection3d (c )
609
611
c .set_edgecolor ('C2' )
610
- c .set_facecolor ('C3' )
612
+ c .set_facecolor (facecolors )
611
613
c .set_alpha (0.7 )
612
614
assert c .get_depthshade ()
613
615
c .set_depthshade (False )
614
616
assert not c .get_depthshade ()
615
617
616
- patch = Circle ((0 , 0 ), 0.05 )
617
- c = art3d .Patch3DCollection ([patch ], linewidths = 3 ,
618
- edgecolor = 'C2' , facecolor = 'C3' , alpha = 0.7 ,
619
- depthshade = False )
618
+ patch1 = Circle ((0 , 0 ), 0.05 )
619
+ patch2 = Circle ((0.1 , 0.1 ), 0.03 )
620
+ facecolors = np .array ([[0. , 0.5 , 0. , 1. ], [0.5 , 0. , 0. , 0.5 ]])
621
+ c = art3d .Patch3DCollection ([patch1 , patch2 ], linewidths = 3 ,
622
+ edgecolor = 'C2' , facecolor = facecolors ,
623
+ alpha = 0.7 , depthshade = False )
620
624
621
625
ax_ref = fig_ref .add_subplot (projection = '3d' )
622
626
ax_ref .add_collection3d (c )
0 commit comments