@@ -400,14 +400,14 @@ def example_plot(ax, fontsize=12, hide_labels=False):
400
400
401
401
fig = plt .figure ()
402
402
gs0 = 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 )
405
405
406
- for gs in gsl :
406
+ for gs in gs_left :
407
407
ax = fig .add_subplot (gs )
408
408
example_plot (ax )
409
409
axs = []
410
- for gs in gsr :
410
+ for gs in gs_right :
411
411
ax = fig .add_subplot (gs )
412
412
pcm = ax .pcolormesh (arr , ** pc_kwargs )
413
413
ax .set_xlabel ('x-label' )
@@ -456,18 +456,16 @@ def example_plot(ax, fontsize=12, hide_labels=False):
456
456
# Grids of fixed aspect-ratio Axes: "compressed" layout
457
457
# =====================================================
458
458
#
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:
465
463
466
464
fig , axs = plt .subplots (2 , 2 , figsize = (5 , 3 ),
467
465
sharex = True , sharey = True , layout = 'constrained' )
468
466
for ax in axs .flat :
469
467
ax .imshow (arr )
470
- fig .suptitle ('Constrained layout: fixed-aspect plots' )
468
+ fig .suptitle (" fixed-aspect plots, layout='constrained'" )
471
469
472
470
# One obvious way of fixing this is to make the figure size more square,
473
471
# 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):
477
475
sharex = True , sharey = True , layout = 'compressed' )
478
476
for ax in axs .flat :
479
477
ax .imshow (arr )
480
- fig .suptitle ('Compressed layout: fixed-aspect plots' )
478
+ fig .suptitle (" fixed-aspect plots, layout='compressed'" )
481
479
482
480
483
481
###############################################################################
0 commit comments