@@ -126,7 +126,7 @@ def example_plot(ax, fontsize=12, hide_labels=False):
126
126
127
127
# %%
128
128
# If you specify a list of Axes (or other iterable container) to the
129
- # ``ax`` argument of ``colorbar``, constrained_layout will take space from
129
+ # ``ax`` argument of ``colorbar``, *constrained layout* will take space from
130
130
# the specified Axes.
131
131
132
132
fig , axs = plt .subplots (2 , 2 , figsize = (4 , 4 ), layout = "constrained" )
@@ -162,8 +162,8 @@ def example_plot(ax, fontsize=12, hide_labels=False):
162
162
# =======
163
163
#
164
164
# Legends can be placed outside of their parent axis.
165
- # Constrained- layout is designed to handle this for :meth:`.Axes.legend`.
166
- # However, constrained- layout does *not* handle legends being created via
165
+ # * Constrained layout* is designed to handle this for :meth:`.Axes.legend`.
166
+ # However, * constrained layout* does *not* handle legends being created via
167
167
# :meth:`.Figure.legend` (yet).
168
168
169
169
fig , ax = plt .subplots (layout = "constrained" )
@@ -186,7 +186,7 @@ def example_plot(ax, fontsize=12, hide_labels=False):
186
186
# with ``fig.savefig('outname.png', bbox_inches='tight')``. Note,
187
187
# however, that the legend's ``get_in_layout`` status will have to be
188
188
# toggled again to make the saved file work, and we must manually
189
- # trigger a draw if we want constrained_layout to adjust the size
189
+ # trigger a draw if we want *constrained layout* to adjust the size
190
190
# of the Axes before printing.
191
191
192
192
fig , axs = plt .subplots (1 , 2 , figsize = (4 , 2 ), layout = "constrained" )
@@ -195,7 +195,7 @@ def example_plot(ax, fontsize=12, hide_labels=False):
195
195
axs [1 ].plot (np .arange (10 ), label = 'This is a plot' )
196
196
leg = axs [1 ].legend (loc = 'center left' , bbox_to_anchor = (0.8 , 0.5 ))
197
197
leg .set_in_layout (False )
198
- # trigger a draw so that constrained_layout is executed once
198
+ # trigger a draw so that constrained layout is executed once
199
199
# before we turn it off when printing....
200
200
fig .canvas .draw ()
201
201
# we want the legend included in the bbox_inches='tight' calcs.
@@ -288,7 +288,7 @@ def example_plot(ax, fontsize=12, hide_labels=False):
288
288
for ax in axs .flat :
289
289
example_plot (ax , hide_labels = True )
290
290
# this has no effect because the space set in the gridspec trumps the
291
- # space set in constrained_layout .
291
+ # space set in *constrained layout* .
292
292
fig .get_layout_engine ().set (w_pad = 4 / 72 , h_pad = 4 / 72 , hspace = 0.0 ,
293
293
wspace = 0.0 )
294
294
@@ -319,7 +319,7 @@ def example_plot(ax, fontsize=12, hide_labels=False):
319
319
# that can be set, either in a script or in the :file:`matplotlibrc`
320
320
# file. They all have the prefix ``figure.constrained_layout``:
321
321
#
322
- # - *use*: Whether to use constrained_layout . Default is False
322
+ # - *use*: Whether to use *constrained layout* . Default is False
323
323
# - *w_pad*, *h_pad*: Padding around Axes objects.
324
324
# Float representing inches. Default is 3./72. inches (3 pts)
325
325
# - *wspace*, *hspace*: Space between subplot groups.
@@ -335,7 +335,7 @@ def example_plot(ax, fontsize=12, hide_labels=False):
335
335
# Use with GridSpec
336
336
# =================
337
337
#
338
- # constrained_layout is meant to be used
338
+ # *Constrained layout* is meant to be used
339
339
# with :func:`~matplotlib.figure.Figure.subplots`,
340
340
# :func:`~matplotlib.figure.Figure.subplot_mosaic`, or
341
341
# :func:`~matplotlib.gridspec.GridSpec` with
@@ -454,7 +454,7 @@ def example_plot(ax, fontsize=12, hide_labels=False):
454
454
# ================================
455
455
#
456
456
# There can be good reasons to manually set an Axes position. A manual call
457
- # to `~.axes.Axes.set_position` will set the Axes so constrained_layout has
457
+ # to `~.axes.Axes.set_position` will set the Axes so *constrained layout* has
458
458
# no effect on it anymore. (Note that *constrained layout* still leaves the
459
459
# space for the Axes that is moved).
460
460
@@ -497,12 +497,12 @@ def example_plot(ax, fontsize=12, hide_labels=False):
497
497
#
498
498
# *Constrained layout* usually adjusts the Axes positions on each draw
499
499
# of the figure. If you want to get the spacing provided by
500
- # *Constrained layout* but not have it update, then do the initial
500
+ # *constrained layout* but not have it update, then do the initial
501
501
# draw and then call ``fig.set_layout_engine('none')``.
502
502
# This is potentially useful for animations where the tick labels may
503
503
# change length.
504
504
#
505
- # Note that *Constrained layout* is turned off for ``ZOOM`` and ``PAN``
505
+ # Note that *constrained layout* is turned off for ``ZOOM`` and ``PAN``
506
506
# GUI events for the backends that use the toolbar. This prevents the
507
507
# Axes from changing position during zooming and panning.
508
508
#
@@ -517,7 +517,7 @@ def example_plot(ax, fontsize=12, hide_labels=False):
517
517
# number of rows and columns is the same for each call.
518
518
# The reason is that each call to `.pyplot.subplot` will create a new
519
519
# `.GridSpec` instance if the geometry is not the same, and
520
- # *Constrained layout*. So the following works fine:
520
+ # *constrained layout*. So the following works fine:
521
521
522
522
fig = plt .figure (layout = "constrained" )
523
523
@@ -588,7 +588,7 @@ def example_plot(ax, fontsize=12, hide_labels=False):
588
588
# Debugging
589
589
# =========
590
590
#
591
- # Constrained- layout can fail in somewhat unexpected ways. Because it uses
591
+ # * Constrained layout* can fail in somewhat unexpected ways. Because it uses
592
592
# a constraint solver the solver can find solutions that are mathematically
593
593
# correct, but that aren't at all what the user wants. The usual failure
594
594
# mode is for all sizes to collapse to their smallest allowable value. If
@@ -615,7 +615,7 @@ def example_plot(ax, fontsize=12, hide_labels=False):
615
615
# into rows and columns, with the relative width of the Axes in those
616
616
# rows and columns set by *width_ratios* and *height_ratios*.
617
617
#
618
- # In constrained_layout , each gridspec gets a *layoutgrid* associated with
618
+ # In *constrained layout* , each gridspec gets a *layoutgrid* associated with
619
619
# it. The *layoutgrid* has a series of ``left`` and ``right`` variables
620
620
# for each column, and ``bottom`` and ``top`` variables for each row, and
621
621
# further it has a margin for each of left, right, bottom and top. In each
0 commit comments