@@ -103,9 +103,9 @@ def test_constrained_layout5():
103
103
def test_constrained_layout6 ():
104
104
'Test constrained_layout for nested gridspecs'
105
105
fig = plt .figure (constrained_layout = True )
106
- gs = gridspec . GridSpec (1 , 2 , figure = fig )
107
- gsl = gridspec . GridSpecFromSubplotSpec (2 , 2 , gs [ 0 ] )
108
- gsr = gridspec . GridSpecFromSubplotSpec (1 , 2 , gs [ 1 ] )
106
+ gs = fig . add_gridspec (1 , 2 , figure = fig )
107
+ gsl = gs [ 0 ]. subgridspec (2 , 2 )
108
+ gsr = gs [ 1 ]. subgridspec (1 , 2 )
109
109
axsl = []
110
110
for gs in gsl :
111
111
ax = fig .add_subplot (gs )
@@ -128,7 +128,7 @@ def test_constrained_layout7():
128
128
with pytest .warns (UserWarning , match = 'Calling figure.constrained_layout, '
129
129
'but figure not setup to do constrained layout' ):
130
130
fig = plt .figure (constrained_layout = True )
131
- gs = gridspec . GridSpec (1 , 2 )
131
+ gs = fig . add_gridspec (1 , 2 )
132
132
gsl = gridspec .GridSpecFromSubplotSpec (2 , 2 , gs [0 ])
133
133
gsr = gridspec .GridSpecFromSubplotSpec (1 , 2 , gs [1 ])
134
134
axsl = []
0 commit comments