@@ -70,26 +70,34 @@ returned *image* now is of type `~.matplotlib.collections.QuadMesh`
70
70
instead of `~.matplotlib.image.AxesImage `.
71
71
72
72
73
- `.matplotlib.Axes.get_tightbbox ` now includes all artists
74
- ---------------------------------------------------------
73
+ `.matplotlib.axes.Axes.get_tightbbox ` now includes all artists
74
+ --------------------------------------------------------------
75
+
76
+ For Matplotlib 3.0, *all * artists are now included in the bounding box
77
+ returned by `.matplotlib.axes.Axes.get_tightbbox `.
78
+
79
+ `.matplotlib.axes.Axes.get_tightbbox ` adds a new kwarg ``bbox_extra_artists ``
80
+ to specify the manually list of artists on the axes to include in the
81
+ tight bounding box calculation.
75
82
76
83
Layout tools like `.Figure.tight_layout `, ``constrained_layout ``,
77
84
and ``fig.savefig('fname.png', bbox_inches="tight") `` use
78
- `.matplotlib.Axes.get_tightbbox ` to determine the bounds of each axes on
85
+ `.matplotlib.axes. Axes.get_tightbbox ` to determine the bounds of each axes on
79
86
a figure and adjust spacing between axes.
80
87
81
88
In Matplotlib 2.2 ``get_tightbbox `` started to include legends made on the
82
89
axes, but still excluded some other artists, like text that may overspill an
83
- axes. For Matplotlib 3.0, *all * artists are now included in the bounding box .
90
+ axes. This has been expanded to include *all * artists.
84
91
85
- This new default may be overridden in either of two ways:
92
+ This new default may be overridden in either of three ways:
86
93
87
94
1. Make the artist to be excluded a child of the figure, not the axes. E.g.,
88
95
call ``fig.legend() `` instead of ``ax.legend() `` (perhaps using
89
- `~.matplotlib.Axes.get_legend_handles_labels ` to gather handles and labels
90
- from the parent axes).
96
+ `~.matplotlib.axes. Axes.get_legend_handles_labels ` to gather handles and
97
+ labels from the parent axes).
91
98
2. If the artist is a child of the axes, set the artist property
92
99
``artist.set_in_layout(False) ``.
100
+ 3. Manually specify a list of artists in the new kwarg ``bbox_extra_artists ``.
93
101
94
102
95
103
`Text.set_text ` with string argument ``None `` sets string to empty
0 commit comments