@@ -6213,6 +6213,36 @@ def test_ytickcolor_is_not_markercolor():
6213
6213
assert tick .tick1line .get_markeredgecolor () != 'white'
6214
6214
6215
6215
6216
+ @pytest .mark .parametrize ('auto' , (True , False , None ))
6217
+ def test_unautoscaley (auto ):
6218
+ fig , ax = plt .subplots ()
6219
+ x = np .arange (100 )
6220
+ y = np .linspace (- .1 , .1 , 100 )
6221
+ ax .scatter (x , y )
6222
+
6223
+ post_auto = ax .get_autoscaley_on () if auto is None else auto
6224
+
6225
+ ax .set_ylim ((- .5 , .5 ), auto = auto )
6226
+ assert post_auto == ax .get_autoscaley_on ()
6227
+ fig .canvas .draw ()
6228
+ assert_array_equal (ax .get_ylim (), (- .5 , .5 ))
6229
+
6230
+
6231
+ @pytest .mark .parametrize ('auto' , (True , False , None ))
6232
+ def test_unautoscalex (auto ):
6233
+ fig , ax = plt .subplots ()
6234
+ x = np .arange (100 )
6235
+ y = np .linspace (- .1 , .1 , 100 )
6236
+ ax .scatter (y , x )
6237
+
6238
+ post_auto = ax .get_autoscalex_on () if auto is None else auto
6239
+
6240
+ ax .set_xlim ((- .5 , .5 ), auto = auto )
6241
+ assert post_auto == ax .get_autoscalex_on ()
6242
+ fig .canvas .draw ()
6243
+ assert_array_equal (ax .get_xlim (), (- .5 , .5 ))
6244
+
6245
+
6216
6246
@check_figures_equal (extensions = ["png" ])
6217
6247
def test_polar_interpolation_steps_variable_r (fig_test , fig_ref ):
6218
6248
l , = fig_test .add_subplot (projection = "polar" ).plot ([0 , np .pi / 2 ], [1 , 2 ])
0 commit comments