1

I have this plot made in pandas:

enter image description here

I want to have more space between the titles of the plots and the axis of the following ones, so that they dont overlap. I have tried the solutions of the question Improve subplot size/spacing with many subplots in matplotlib but none of them makes nothing to my plot.

Javier Lopez Tomas
  • 1,593
  • 1
  • 16
  • 30

1 Answers1

13

You can use plt.tight_layout() after plotting all the figures. This avoids manually playing around with the spacing.

Sheldore
  • 35,129
  • 6
  • 43
  • 58
  • Doing so destroys the aspect ratio of my subplots. Previously they're squares, then after `plt.tight_layout()`, they're rectangles. Do you know how to prevent this? – Rylan Schaeffer May 15 '22 at 22:38