@@ -126,7 +126,7 @@ def example_plot(ax, fontsize=12, hide_labels=False):
126126
127127# %%
128128# 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
130130# the specified Axes.
131131
132132fig , axs = plt .subplots (2 , 2 , figsize = (4 , 4 ), layout = "constrained" )
@@ -162,8 +162,8 @@ def example_plot(ax, fontsize=12, hide_labels=False):
162162# =======
163163#
164164# 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
167167# :meth:`.Figure.legend` (yet).
168168
169169fig , ax = plt .subplots (layout = "constrained" )
@@ -186,7 +186,7 @@ def example_plot(ax, fontsize=12, hide_labels=False):
186186# with ``fig.savefig('outname.png', bbox_inches='tight')``. Note,
187187# however, that the legend's ``get_in_layout`` status will have to be
188188# 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
190190# of the Axes before printing.
191191
192192fig , axs = plt .subplots (1 , 2 , figsize = (4 , 2 ), layout = "constrained" )
@@ -195,7 +195,7 @@ def example_plot(ax, fontsize=12, hide_labels=False):
195195axs [1 ].plot (np .arange (10 ), label = 'This is a plot' )
196196leg = axs [1 ].legend (loc = 'center left' , bbox_to_anchor = (0.8 , 0.5 ))
197197leg .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
199199# before we turn it off when printing....
200200fig .canvas .draw ()
201201# we want the legend included in the bbox_inches='tight' calcs.
@@ -288,7 +288,7 @@ def example_plot(ax, fontsize=12, hide_labels=False):
288288for ax in axs .flat :
289289 example_plot (ax , hide_labels = True )
290290# 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* .
292292fig .get_layout_engine ().set (w_pad = 4 / 72 , h_pad = 4 / 72 , hspace = 0.0 ,
293293 wspace = 0.0 )
294294
@@ -319,7 +319,7 @@ def example_plot(ax, fontsize=12, hide_labels=False):
319319# that can be set, either in a script or in the :file:`matplotlibrc`
320320# file. They all have the prefix ``figure.constrained_layout``:
321321#
322- # - *use*: Whether to use constrained_layout . Default is False
322+ # - *use*: Whether to use *constrained layout* . Default is False
323323# - *w_pad*, *h_pad*: Padding around Axes objects.
324324# Float representing inches. Default is 3./72. inches (3 pts)
325325# - *wspace*, *hspace*: Space between subplot groups.
@@ -335,7 +335,7 @@ def example_plot(ax, fontsize=12, hide_labels=False):
335335# Use with GridSpec
336336# =================
337337#
338- # constrained_layout is meant to be used
338+ # *Constrained layout* is meant to be used
339339# with :func:`~matplotlib.figure.Figure.subplots`,
340340# :func:`~matplotlib.figure.Figure.subplot_mosaic`, or
341341# :func:`~matplotlib.gridspec.GridSpec` with
@@ -454,7 +454,7 @@ def example_plot(ax, fontsize=12, hide_labels=False):
454454# ================================
455455#
456456# 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
458458# no effect on it anymore. (Note that *constrained layout* still leaves the
459459# space for the Axes that is moved).
460460
@@ -497,12 +497,12 @@ def example_plot(ax, fontsize=12, hide_labels=False):
497497#
498498# *Constrained layout* usually adjusts the Axes positions on each draw
499499# 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
501501# draw and then call ``fig.set_layout_engine('none')``.
502502# This is potentially useful for animations where the tick labels may
503503# change length.
504504#
505- # Note that *Constrained layout* is turned off for ``ZOOM`` and ``PAN``
505+ # Note that *constrained layout* is turned off for ``ZOOM`` and ``PAN``
506506# GUI events for the backends that use the toolbar. This prevents the
507507# Axes from changing position during zooming and panning.
508508#
@@ -517,7 +517,7 @@ def example_plot(ax, fontsize=12, hide_labels=False):
517517# number of rows and columns is the same for each call.
518518# The reason is that each call to `.pyplot.subplot` will create a new
519519# `.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:
521521
522522fig = plt .figure (layout = "constrained" )
523523
@@ -588,7 +588,7 @@ def example_plot(ax, fontsize=12, hide_labels=False):
588588# Debugging
589589# =========
590590#
591- # Constrained- layout can fail in somewhat unexpected ways. Because it uses
591+ # * Constrained layout* can fail in somewhat unexpected ways. Because it uses
592592# a constraint solver the solver can find solutions that are mathematically
593593# correct, but that aren't at all what the user wants. The usual failure
594594# 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):
615615# into rows and columns, with the relative width of the Axes in those
616616# rows and columns set by *width_ratios* and *height_ratios*.
617617#
618- # In constrained_layout , each gridspec gets a *layoutgrid* associated with
618+ # In *constrained layout* , each gridspec gets a *layoutgrid* associated with
619619# it. The *layoutgrid* has a series of ``left`` and ``right`` variables
620620# for each column, and ``bottom`` and ``top`` variables for each row, and
621621# further it has a margin for each of left, right, bottom and top. In each
0 commit comments