@@ -400,14 +400,14 @@ def example_plot(ax, fontsize=12, hide_labels=False):
400400
401401fig = plt .figure ()
402402gs0 = fig .add_gridspec (1 , 2 , figure = fig , width_ratios = [1. , 2. ])
403- gsl = gs0 [0 ].subgridspec (2 , 1 )
404- gsr = gs0 [1 ].subgridspec (2 , 2 )
403+ gs_left = gs0 [0 ].subgridspec (2 , 1 )
404+ gs_right = gs0 [1 ].subgridspec (2 , 2 )
405405
406- for gs in gsl :
406+ for gs in gs_left :
407407 ax = fig .add_subplot (gs )
408408 example_plot (ax )
409409axs = []
410- for gs in gsr :
410+ for gs in gs_right :
411411 ax = fig .add_subplot (gs )
412412 pcm = ax .pcolormesh (arr , ** pc_kwargs )
413413 ax .set_xlabel ('x-label' )
@@ -456,18 +456,16 @@ def example_plot(ax, fontsize=12, hide_labels=False):
456456# Grids of fixed aspect-ratio Axes: "compressed" layout
457457# =====================================================
458458#
459- #
460- # By default, ``constrained_layout`` acts on the original position of an axes.
461- # However, when Axes have fixed aspect ratios, one side is made shorter. For
462- # a grid of such Axes, this can leave a large gap in the shortened direction.
463- # In the following the Axes are square, but the figure quite wide so there is
464- # a horizontal gap:
459+ # ``constrained_layout`` operates on the grid of "original" positions for
460+ # axes. However, when Axes have fixed aspect ratios, one side is usually made
461+ # shorter, and leaves large gaps in the shortened direction. In the following,
462+ # the Axes are square, but the figure quite wide so there is a horizontal gap:
465463
466464fig , axs = plt .subplots (2 , 2 , figsize = (5 , 3 ),
467465 sharex = True , sharey = True , layout = 'constrained' )
468466for ax in axs .flat :
469467 ax .imshow (arr )
470- fig .suptitle ('Constrained layout: fixed-aspect plots' )
468+ fig .suptitle (" fixed-aspect plots, layout='constrained'" )
471469
472470# One obvious way of fixing this is to make the figure size more square,
473471# however, closing the gaps exactly requires trial and error. For simple grids
@@ -477,7 +475,7 @@ def example_plot(ax, fontsize=12, hide_labels=False):
477475 sharex = True , sharey = True , layout = 'compressed' )
478476for ax in axs .flat :
479477 ax .imshow (arr )
480- fig .suptitle ('Compressed layout: fixed-aspect plots' )
478+ fig .suptitle (" fixed-aspect plots, layout='compressed'" )
481479
482480
483481###############################################################################
0 commit comments