@@ -71,7 +71,6 @@ def example_plot(ax, fontsize=12, hide_labels=False):
7171 ax .set_ylabel ('y-label' , fontsize = fontsize )
7272 ax .set_title ('Title' , fontsize = fontsize )
7373
74-
7574fig , ax = plt .subplots (constrained_layout = False )
7675example_plot (ax , fontsize = 24 )
7776
@@ -508,6 +507,7 @@ def docomplicated(suptitle=None):
508507example_plot (ax3 )
509508example_plot (ax4 )
510509fig .suptitle ('subplot2grid' )
510+ plt .show ()
511511
512512###############################################################################
513513# Other Caveats
@@ -588,7 +588,7 @@ def docomplicated(suptitle=None):
588588
589589fig , ax = plt .subplots (constrained_layout = True )
590590example_plot (ax , fontsize = 24 )
591- plot_children (fig , fig . _layoutgrid )
591+ plot_children (fig )
592592
593593#######################################################################
594594# Simple case: two Axes
@@ -603,7 +603,7 @@ def docomplicated(suptitle=None):
603603fig , ax = plt .subplots (1 , 2 , constrained_layout = True )
604604example_plot (ax [0 ], fontsize = 32 )
605605example_plot (ax [1 ], fontsize = 8 )
606- plot_children (fig , fig . _layoutgrid , printit = False )
606+ plot_children (fig , printit = False )
607607
608608#######################################################################
609609# Two Axes and colorbar
@@ -616,7 +616,7 @@ def docomplicated(suptitle=None):
616616im = ax [0 ].pcolormesh (arr , ** pc_kwargs )
617617fig .colorbar (im , ax = ax [0 ], shrink = 0.6 )
618618im = ax [1 ].pcolormesh (arr , ** pc_kwargs )
619- plot_children (fig , fig . _layoutgrid )
619+ plot_children (fig )
620620
621621#######################################################################
622622# Colorbar associated with a Gridspec
@@ -629,7 +629,7 @@ def docomplicated(suptitle=None):
629629for ax in axs .flat :
630630 im = ax .pcolormesh (arr , ** pc_kwargs )
631631fig .colorbar (im , ax = axs , shrink = 0.6 )
632- plot_children (fig , fig . _layoutgrid , printit = False )
632+ plot_children (fig , printit = False )
633633
634634#######################################################################
635635# Uneven sized Axes
@@ -654,7 +654,7 @@ def docomplicated(suptitle=None):
654654im = ax .pcolormesh (arr , ** pc_kwargs )
655655ax = fig .add_subplot (gs [1 , 1 ])
656656im = ax .pcolormesh (arr , ** pc_kwargs )
657- plot_children (fig , fig . _layoutgrid , printit = False )
657+ plot_children (fig , printit = False )
658658
659659#######################################################################
660660# One case that requires finessing is if margins do not have any artists
@@ -669,4 +669,5 @@ def docomplicated(suptitle=None):
669669ax01 = fig .add_subplot (gs [0 , 2 :])
670670ax10 = fig .add_subplot (gs [1 , 1 :3 ])
671671example_plot (ax10 , fontsize = 14 )
672- plot_children (fig , fig ._layoutgrid )
672+ plot_children (fig )
673+ plt .show ()
0 commit comments