Routines to adjust subplot params so that subplots are nicely fit in the figure. In doing so, only axis labels, tick labels, axes titles and offsetboxes that are anchored to axes are currently considered.
Internally, this module assumes that the margins (left margin, etc.) which are differences between Axes.get_tightbbox
and Axes.bbox
are independent of Axes position. This may fail if Axes.adjustable
is datalim
as well as such cases as when left or right margin are affected by xlabel.
[Deprecated] Return a dict of subplot parameters to adjust spacing between subplots or None
if resulting axes would have zero height or width.
Note that this function ignores geometry information of subplot itself, but uses what is given by the nrows_ncols and num1num2_list parameters. Also, the results could be incorrect if some subplots have adjustable=datalim
.
Number of rows and number of columns of the grid.
List of numbers specifying the area occupied by the subplot
List of subplots that will be used to calculate optimal subplot_params.
Padding between the figure edge and the edges of subplots, as a fraction of the font size.
Padding (height/width) between edges of adjacent subplots, as a fraction of the font size. Defaults to pad.
[left, bottom, right, top] in normalized (0, 1) figure coordinates.
Deprecated since version 3.5.
Return a list of subplotspec from the given list of axes.
For an instance of axes that does not support subplotspec, None is inserted in the list.
If grid_spec is given, None is inserted for those not from the given grid_spec.
Return subplot parameters for tight-layouted-figure with specified padding.
SubplotSpec
The subplotspecs of each axes.
Padding between the figure edge and the edges of subplots, as a fraction of the font size.
Padding (height/width) between edges of adjacent subplots. Defaults to pad.
(left, bottom, right, top) rectangle in normalized figure coordinates that the whole subplots area (including labels) will fit into. Defaults to using the entire figure.
subplotspec kwargs to be passed to Figure.subplots_adjust
or None if tight_layout could not be accomplished.
© 2012–2021 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/3.5.1/api/tight_layout_api.html