@@ -399,7 +399,7 @@ def example_plot(ax, fontsize=12, hide_labels=False):
399399# the same effect can be achieved using `~.Figure.subfigures`.
400400
401401fig = plt .figure ()
402- gs0 = fig .add_gridspec (1 , 2 , figure = fig , width_ratios = [1. , 2. ])
402+ gs0 = fig .add_gridspec (1 , 2 , figure = fig , width_ratios = [1 , 2 ])
403403gs_left = gs0 [0 ].subgridspec (2 , 1 )
404404gs_right = gs0 [1 ].subgridspec (2 , 2 )
405405
@@ -424,17 +424,17 @@ def example_plot(ax, fontsize=12, hide_labels=False):
424424fig = plt .figure ()
425425sfigs = fig .subfigures (1 , 2 , width_ratios = [1 , 2 ])
426426
427- axsleft = sfigs [0 ].subplots (2 , 1 )
428- for ax in axsleft .flat :
427+ axs_left = sfigs [0 ].subplots (2 , 1 )
428+ for ax in axs_left .flat :
429429 example_plot (ax )
430430
431- axsright = sfigs [1 ].subplots (2 , 2 )
432- for ax in axsright .flat :
431+ axs_right = sfigs [1 ].subplots (2 , 2 )
432+ for ax in axs_right .flat :
433433 pcm = ax .pcolormesh (arr , ** pc_kwargs )
434434 ax .set_xlabel ('x-label' )
435435 ax .set_ylabel ('y-label' )
436436 ax .set_title ('title' )
437- fig .colorbar (pcm , ax = axsright )
437+ fig .colorbar (pcm , ax = axs_right )
438438fig .suptitle ('Nested plots using subfigures' )
439439
440440###############################################################################
@@ -467,7 +467,8 @@ def example_plot(ax, fontsize=12, hide_labels=False):
467467 ax .imshow (arr )
468468fig .suptitle ("fixed-aspect plots, layout='constrained'" )
469469
470- # One obvious way of fixing this is to make the figure size more square,
470+ ###############################################################################
471+ # One obvious way of fixing this is to make the figure size more square,
471472# however, closing the gaps exactly requires trial and error. For simple grids
472473# of Axes we can use ``layout="compressed"`` to do the job for us:
473474
0 commit comments