Skip to content

Commit 8a3ec2f

Browse files
authored
DOC: update tight layout guide with set_in_layout (#18100)
* DOC: update tight layout guide with set_in_layout * DOC: update tight layout guide with set_in_layout
1 parent 3c8af99 commit 8a3ec2f

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

tutorials/intermediate/tight_layout_guide.py

+9-10
Original file line numberDiff line numberDiff line change
@@ -152,18 +152,17 @@ def example_plot(ax, fontsize=12):
152152
# Caveats
153153
# =======
154154
#
155-
# * :func:`~matplotlib.pyplot.tight_layout` only considers ticklabels, axis
156-
# labels, and titles. Thus, other artists may be clipped and also may
157-
# overlap.
155+
# * `~matplotlib.pyplot.tight_layout` considers all artists on the axes by
156+
# default. To remove an artist from the layout calculation you can call
157+
# `.Artist.set_in_layout`.
158158
#
159-
# * It assumes that the extra space needed for ticklabels, axis labels,
160-
# and titles is independent of original location of axes. This is
161-
# often true, but there are rare cases where it is not.
159+
# * ``tight_layout`` assumes that the extra space needed for artists is
160+
# independent of the original location of axes. This is often true, but there
161+
# are rare cases where it is not.
162162
#
163-
# * pad=0 clips some of the texts by a few pixels. This may be a bug or
164-
# a limitation of the current algorithm and it is not clear why it
165-
# happens. Meanwhile, use of pad at least larger than 0.3 is
166-
# recommended.
163+
# * ``pad=0`` can clip some texts by a few pixels. This may be a bug or
164+
# a limitation of the current algorithm and it is not clear why it
165+
# happens. Meanwhile, use of pad larger than 0.3 is recommended.
167166
#
168167
# Use with GridSpec
169168
# =================

0 commit comments

Comments
 (0)