@@ -6251,6 +6251,36 @@ def test_ytickcolor_is_not_markercolor():
6251
6251
assert tick .tick1line .get_markeredgecolor () != 'white'
6252
6252
6253
6253
6254
+ @pytest .mark .parametrize ('auto' , (True , False , None ))
6255
+ def test_unautoscaley (auto ):
6256
+ fig , ax = plt .subplots ()
6257
+ x = np .arange (100 )
6258
+ y = np .linspace (- .1 , .1 , 100 )
6259
+ ax .scatter (x , y )
6260
+
6261
+ post_auto = ax .get_autoscaley_on () if auto is None else auto
6262
+
6263
+ ax .set_ylim ((- .5 , .5 ), auto = auto )
6264
+ assert post_auto == ax .get_autoscaley_on ()
6265
+ fig .canvas .draw ()
6266
+ assert_array_equal (ax .get_ylim (), (- .5 , .5 ))
6267
+
6268
+
6269
+ @pytest .mark .parametrize ('auto' , (True , False , None ))
6270
+ def test_unautoscalex (auto ):
6271
+ fig , ax = plt .subplots ()
6272
+ x = np .arange (100 )
6273
+ y = np .linspace (- .1 , .1 , 100 )
6274
+ ax .scatter (y , x )
6275
+
6276
+ post_auto = ax .get_autoscalex_on () if auto is None else auto
6277
+
6278
+ ax .set_xlim ((- .5 , .5 ), auto = auto )
6279
+ assert post_auto == ax .get_autoscalex_on ()
6280
+ fig .canvas .draw ()
6281
+ assert_array_equal (ax .get_xlim (), (- .5 , .5 ))
6282
+
6283
+
6254
6284
@check_figures_equal (extensions = ["png" ])
6255
6285
def test_polar_interpolation_steps_variable_r (fig_test , fig_ref ):
6256
6286
l , = fig_test .add_subplot (projection = "polar" ).plot ([0 , np .pi / 2 ], [1 , 2 ])
0 commit comments