Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b1bac4c

Browse filesBrowse files
committed
Document auto-tightlayouting.
1 parent df6acf9 commit b1bac4c
Copy full SHA for b1bac4c

File tree

Expand file treeCollapse file tree

1 file changed

+9
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-4
lines changed

‎tutorials/intermediate/tight_layout_guide.py

Copy file name to clipboardExpand all lines: tutorials/intermediate/tight_layout_guide.py
+9-4Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ def example_plot(ax, fontsize=12):
5151
plt.tight_layout()
5252

5353
###############################################################################
54+
# Note that :func:`matplotlib.pyplot.tight_layout` will only adjust the
55+
# subplot params when it is called. In order to perform this adjustment each
56+
# time the figure is redrawn, you can call ``fig.set_tight_layout(True)``, or,
57+
# equivalently, set the ``figure.autolayout`` rcParam to ``True``.
58+
#
5459
# When you have multiple subplots, often you see labels of different
5560
# axes overlapping each other.
5661

@@ -141,7 +146,7 @@ def example_plot(ax, fontsize=12):
141146

142147
###############################################################################
143148
# Caveats
144-
# -------
149+
# =======
145150
#
146151
# * :func:`~matplotlib.pyplot.tight_layout` only considers ticklabels, axis
147152
# labels, and titles. Thus, other artists may be clipped and also may
@@ -157,7 +162,7 @@ def example_plot(ax, fontsize=12):
157162
# recommended.
158163
#
159164
# Use with GridSpec
160-
# -----------------
165+
# =================
161166
#
162167
# GridSpec has its own :func:`~matplotlib.gridspec.GridSpec.tight_layout` method
163168
# (the pyplot api :func:`~matplotlib.pyplot.tight_layout` also works).
@@ -275,7 +280,7 @@ def example_plot(ax, fontsize=12):
275280

276281
###############################################################################
277282
# Use with AxesGrid1
278-
# ------------------
283+
# ==================
279284
#
280285
# While limited, the axes_grid1 toolkit is also supported.
281286

@@ -295,7 +300,7 @@ def example_plot(ax, fontsize=12):
295300

296301
###############################################################################
297302
# Colorbar
298-
# --------
303+
# ========
299304
#
300305
# If you create a colorbar with the :func:`~matplotlib.pyplot.colorbar`
301306
# command, the created colorbar is an instance of Axes, *not* Subplot, so

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.