File tree 2 files changed +14
-7
lines changed
galleries/users_explain/axes
2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 9
9
10
10
How to use tight-layout to fit plots within your figure cleanly.
11
11
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
+
12
18
*tight_layout* automatically adjusts subplot params so that the
13
19
subplot(s) fits in to the figure area. This is an experimental
14
20
feature and may not work for some cases. It only checks the extents
15
21
of ticklabels, axis labels, and titles.
16
22
17
- An alternative to *tight_layout* is :ref:`constrained_layout
18
- <constrainedlayout_guide>`.
19
-
20
-
21
23
Simple example
22
24
==============
23
25
Original file line number Diff line number Diff line change 10
10
layout engine while the figure is being created. In particular, colorbars are
11
11
made differently with different layout engines (for historical reasons).
12
12
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`.
16
21
"""
17
22
18
23
from contextlib import nullcontext
You can’t perform that action at this time.
0 commit comments