@@ -103,9 +103,9 @@ def test_constrained_layout5():
103103def test_constrained_layout6 ():
104104 'Test constrained_layout for nested gridspecs'
105105 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 )
109109 axsl = []
110110 for gs in gsl :
111111 ax = fig .add_subplot (gs )
@@ -128,7 +128,7 @@ def test_constrained_layout7():
128128 with pytest .warns (UserWarning , match = 'Calling figure.constrained_layout, '
129129 'but figure not setup to do constrained layout' ):
130130 fig = plt .figure (constrained_layout = True )
131- gs = gridspec . GridSpec (1 , 2 )
131+ gs = fig . add_gridspec (1 , 2 )
132132 gsl = gridspec .GridSpecFromSubplotSpec (2 , 2 , gs [0 ])
133133 gsr = gridspec .GridSpecFromSubplotSpec (1 , 2 , gs [1 ])
134134 axsl = []
0 commit comments