Skip to content

Commit bd8791d

Browse files
authored
Merge pull request #10625 from anntzer/constrainedlayoutmarkup
Fixes to constrainedlayout tutorial markup.
2 parents 3f3065d + 606d398 commit bd8791d

File tree

1 file changed

+21
-23
lines changed

1 file changed

+21
-23
lines changed

tutorials/intermediate/constrainedlayout_guide.py

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -223,19 +223,19 @@ def example_plot(ax, fontsize=12, nodec=False):
223223
hspace=0.2, wspace=0.2)
224224

225225
##########################################
226-
# rcParams:
227-
# -----------
226+
# rcParams
227+
# --------
228228
#
229229
# There are five `rcParams` that can be set, either in a script
230230
# or in the `matplotlibrc` file. They all have the prefix
231231
# `figure.constrained_layout`:
232232
#
233-
# - `use`: Whether to use constrained_layout. Default is False
234-
# - `w_pad`, `h_pad` Padding around axes objects.
235-
# Float representing inches. Default is 3./72. inches (3 pts)
236-
# - `wspace`, `hspace` Space between subplot groups.
237-
# Float representing a fraction of the subplot widths being separated.
238-
# Default is 0.02.
233+
# - `use`: Whether to use constrained_layout. Default is False
234+
# - `w_pad`, `h_pad` Padding around axes objects.
235+
# Float representing inches. Default is 3./72. inches (3 pts)
236+
# - `wspace`, `hspace` Space between subplot groups.
237+
# Float representing a fraction of the subplot widths being separated.
238+
# Default is 0.02.
239239

240240
plt.rcParams['figure.constrained_layout.use'] = True
241241
fig, axs = plt.subplots(2, 2, figsize=(3, 3))
@@ -446,16 +446,15 @@ def docomplicated(suptitle=None):
446446
# Other Caveats
447447
# -------------
448448
#
449-
# * ``constrained_layout`` only considers ticklabels,
450-
# axis labels, titles, and legends. Thus, other artists may be clipped
451-
# and also may overlap.
449+
# * ``constrained_layout`` only considers ticklabels, axis labels, titles, and
450+
# legends. Thus, other artists may be clipped and also may overlap.
452451
#
453-
# * It assumes that the extra space needed for ticklabels, axis labels,
454-
# and titles is independent of original location of axes. This is
455-
# often true, but there are rare cases where it is not.
452+
# * It assumes that the extra space needed for ticklabels, axis labels,
453+
# and titles is independent of original location of axes. This is
454+
# often true, but there are rare cases where it is not.
456455
#
457-
# * There are small differences in how the backends handle rendering fonts,
458-
# so the results will not be pixel-identical.
456+
# * There are small differences in how the backends handle rendering fonts,
457+
# so the results will not be pixel-identical.
459458

460459
###########################################################
461460
# Debugging
@@ -467,9 +466,9 @@ def docomplicated(suptitle=None):
467466
# mode is for all sizes to collapse to their smallest allowable value. If
468467
# this happens, it is for one of two reasons:
469468
#
470-
# 1. There was not enough room for the elements you were requesting to draw
471-
# 2. There is a bug - in which case open an issue at
472-
# https://github.com/matplotlib/matplotlib/issues.
469+
# 1. There was not enough room for the elements you were requesting to draw.
470+
# 2. There is a bug - in which case open an issue at
471+
# https://github.com/matplotlib/matplotlib/issues.
473472
#
474473
# If there is a bug, please report with a self-contained example that does
475474
# not require outside data or dependencies (other than numpy).
@@ -632,11 +631,10 @@ def docomplicated(suptitle=None):
632631
# height of the 1-row Axes to be less than half the height of the
633632
# 2-row Axes.
634633
#
635-
# ..note::
634+
# .. note::
636635
#
637-
# This algorithm can be wrong if the decorations attached
638-
# to the smaller axes are very large, so there is an unaccounted-for
639-
# edge case.
636+
# This algorithm can be wrong if the decorations attached to the smaller
637+
# axes are very large, so there is an unaccounted-for edge case.
640638

641639

642640
fig = plt.figure(constrained_layout=True)

0 commit comments

Comments
 (0)