@@ -4324,8 +4324,7 @@ def test_twin_spines():
4324
4324
def make_patch_spines_invisible (ax ):
4325
4325
ax .set_frame_on (True )
4326
4326
ax .patch .set_visible (False )
4327
- for sp in ax .spines .values ():
4328
- sp .set_visible (False )
4327
+ ax .spines .all .set_visible (False )
4329
4328
4330
4329
fig = plt .figure (figsize = (4 , 3 ))
4331
4330
fig .subplots_adjust (right = 0.75 )
@@ -4336,13 +4335,13 @@ def make_patch_spines_invisible(ax):
4336
4335
4337
4336
# Offset the right spine of par2. The ticks and label have already been
4338
4337
# placed on the right by twinx above.
4339
- par2 .spines [ " right" ] .set_position (("axes" , 1.2 ))
4338
+ par2 .spines . right .set_position (("axes" , 1.2 ))
4340
4339
# Having been created by twinx, par2 has its frame off, so the line of
4341
4340
# its detached spine is invisible. First, activate the frame but make
4342
4341
# the patch and spines invisible.
4343
4342
make_patch_spines_invisible (par2 )
4344
4343
# Second, show the right spine.
4345
- par2 .spines [ " right" ] .set_visible (True )
4344
+ par2 .spines . right .set_visible (True )
4346
4345
4347
4346
p1 , = host .plot ([0 , 1 , 2 ], [0 , 1 , 2 ], "b-" )
4348
4347
p2 , = par1 .plot ([0 , 1 , 2 ], [0 , 3 , 2 ], "r-" )
@@ -5485,8 +5484,7 @@ def test_axisbelow():
5485
5484
ax .grid (color = 'c' , linestyle = '-' , linewidth = 3 )
5486
5485
ax .tick_params (top = False , bottom = False ,
5487
5486
left = False , right = False )
5488
- for spine in ax .spines .values ():
5489
- spine .set_visible (False )
5487
+ ax .spines .all .set_visible (False )
5490
5488
ax .set_axisbelow (setting )
5491
5489
5492
5490
@@ -5881,11 +5879,11 @@ def test_set_position():
5881
5879
5882
5880
def test_spines_properbbox_after_zoom ():
5883
5881
fig , ax = plt .subplots ()
5884
- bb = ax .spines [ ' bottom' ] .get_window_extent (fig .canvas .get_renderer ())
5882
+ bb = ax .spines . bottom .get_window_extent (fig .canvas .get_renderer ())
5885
5883
# this is what zoom calls:
5886
5884
ax ._set_view_from_bbox ((320 , 320 , 500 , 500 ), 'in' ,
5887
5885
None , False , False )
5888
- bb2 = ax .spines [ ' bottom' ] .get_window_extent (fig .canvas .get_renderer ())
5886
+ bb2 = ax .spines . bottom .get_window_extent (fig .canvas .get_renderer ())
5889
5887
np .testing .assert_allclose (bb .get_points (), bb2 .get_points (), rtol = 1e-6 )
5890
5888
5891
5889
@@ -6153,7 +6151,7 @@ def test_displaced_spine():
6153
6151
with rc_context ({'_internal.classic_mode' : False }):
6154
6152
fig , ax = plt .subplots (dpi = 200 , figsize = (6 , 6 ))
6155
6153
ax .set (xticklabels = [], yticklabels = [])
6156
- ax .spines [ ' bottom' ] .set_position (('axes' , - 0.1 ))
6154
+ ax .spines . bottom .set_position (('axes' , - 0.1 ))
6157
6155
fig .canvas .draw ()
6158
6156
bbaxis , bbspines , bbax , bbtb = color_boxes (fig , ax )
6159
6157
0 commit comments