@@ -249,6 +249,8 @@ def test_polar_theta_limits():
249249 direction = DIRECTIONS [i % len (DIRECTIONS )],
250250 rotation = 'auto' )
251251 ax .yaxis .set_tick_params (label2On = True , rotation = 'auto' )
252+ ax .xaxis .get_major_locator ().base .set_params ( # backcompat
253+ steps = [1 , 2 , 2.5 , 5 , 10 ])
252254
253255
254256@check_figures_equal (extensions = ["png" ])
@@ -357,3 +359,17 @@ def test_thetalim_args():
357359 assert tuple (np .radians ((ax .get_thetamin (), ax .get_thetamax ()))) == (0 , 1 )
358360 ax .set_thetalim ((2 , 3 ))
359361 assert tuple (np .radians ((ax .get_thetamin (), ax .get_thetamax ()))) == (2 , 3 )
362+
363+
364+ def test_default_thetalocator ():
365+ # Ideally we would check AAAABBC, but the smallest axes currently puts a
366+ # single tick at 150° because MaxNLocator doesn't have a way to accept 15°
367+ # while rejecting 150°.
368+ fig , axs = plt .subplot_mosaic (
369+ "AAAABB." , subplot_kw = {"projection" : "polar" })
370+ for ax in axs .values ():
371+ ax .set_thetalim (0 , np .pi )
372+ for ax in axs .values ():
373+ ticklocs = np .degrees (ax .xaxis .get_majorticklocs ()).tolist ()
374+ assert pytest .approx (90 ) in ticklocs
375+ assert pytest .approx (100 ) not in ticklocs
0 commit comments