File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
lib/mpl_toolkits/mplot3d/tests Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -2124,3 +2124,29 @@ def test_panecolor_rcparams():
21242124 'axes3d.zaxis.panecolor' : 'b' }):
21252125 fig = plt .figure (figsize = (1 , 1 ))
21262126 fig .add_subplot (projection = '3d' )
2127+
2128+
2129+ @check_figures_equal (extensions = ["png" ])
2130+ def test_mutating_input_arrays_y_and_z (fig_test , fig_ref ):
2131+ """
2132+ Test to see if the `z` axis does not get mutated
2133+ after a call to `Axes3D.plot`
2134+
2135+ test cases came from GH#8990
2136+ """
2137+ ax1 = fig_test .add_subplot (111 , projection = '3d' )
2138+ x = [1 , 2 , 3 ]
2139+ y = [0.0 , 0.0 , 0.0 ]
2140+ z = [0.0 , 0.0 , 0.0 ]
2141+ ax1 .plot (x , y , z , 'o-' )
2142+
2143+ # mutate y,z to get a nontrivial line
2144+ y [:] = [1 , 2 , 3 ]
2145+ z [:] = [1 , 2 , 3 ]
2146+
2147+ # draw the same plot without mutating x and y
2148+ ax2 = fig_ref .add_subplot (111 , projection = '3d' )
2149+ x = [1 , 2 , 3 ]
2150+ y = [0.0 , 0.0 , 0.0 ]
2151+ z = [0.0 , 0.0 , 0.0 ]
2152+ ax2 .plot (x , y , z , 'o-' )
You can’t perform that action at this time.
0 commit comments