Adjust the padding between and around subplots.
To exclude an artist on the Axes from the bounding box calculation that determines the subplot parameters (i.e. legend, or annotation), set a.set_in_layout(False) for that artist.
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.
A rectangle in normalized figure coordinates into which the whole subplots area (including labels) will fit.
matplotlib.figure.Figure.tight_layout
Combining two subplots using subplots and GridSpec
Demo of the histogram function's different histtype settings
The histogram (hist) function with multiple data sets
© 2012–2023 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/stable/api/_as_gen/matplotlib.figure.Figure.tight_layout.html