File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
lib/mpl_toolkits/mplot3d/tests Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -2124,3 +2124,37 @@ 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+ ax1 .set_ylim ([0 , 4 ])
2144+ ax1 .set_zlim ([0 , 4 ])
2145+ fig_test .draw_without_rendering ()
2146+
2147+ # mutate y,z to get a nontrivial line
2148+ y [:] = [1 , 2 , 3 ]
2149+ z [:] = [1 , 2 , 3 ]
2150+
2151+ # draw the same plot without mutating x and y
2152+ ax2 = fig_ref .add_subplot (111 , projection = '3d' )
2153+ x = [1 , 2 , 3 ]
2154+ y = [0.0 , 0.0 , 0.0 ]
2155+ z = [0.0 , 0.0 , 0.0 ]
2156+ ax2 .plot (x , y , z , 'o-' )
2157+
2158+ ax2 .set_ylim ([0 , 4 ])
2159+ ax2 .set_zlim ([0 , 4 ])
2160+ fig_test .draw_without_rendering ()
You can’t perform that action at this time.
0 commit comments