File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed
galleries/users_explain/axes Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 99
1010How to use tight-layout to fit plots within your figure cleanly.
1111
12+ .. tip::
13+
14+ *tight_layout* was the first layout engine in Matplotlib. The more modern
15+ and more capable :ref:`Constrained Layout <constrainedlayout_guide>` should
16+ typically be used instead.
17+
1218*tight_layout* automatically adjusts subplot params so that the
1319subplot(s) fits in to the figure area. This is an experimental
1420feature and may not work for some cases. It only checks the extents
1521of ticklabels, axis labels, and titles.
1622
17- An alternative to *tight_layout* is :ref:`constrained_layout
18- <constrainedlayout_guide>`.
19-
20-
2123Simple example
2224==============
2325
Original file line number Diff line number Diff line change 1010layout engine while the figure is being created. In particular, colorbars are
1111made differently with different layout engines (for historical reasons).
1212
13- Matplotlib supplies two layout engines, `.TightLayoutEngine` and
14- `.ConstrainedLayoutEngine`. Third parties can create their own layout engine
15- by subclassing `.LayoutEngine`.
13+ Matplotlib has two built-in layout engines:
14+
15+ - `.TightLayoutEngine` was the first layout engine added to Matplotlib.
16+ See also :ref:`tight_layout_guide`.
17+ - `.ConstrainedLayoutEngine` is more modern and generally gives better results.
18+ See also :ref:`constrainedlayout_guide`.
19+
20+ Third parties can create their own layout engine by subclassing `.LayoutEngine`.
1621"""
1722
1823from contextlib import nullcontext
You can’t perform that action at this time.
0 commit comments