If I add a subtitle to my matplotlib figure it gets overlaid by the subplot\'s titles. Does anybody know how to easily take care of that? I tried the tight_layout()
Tight layout doesn't work with suptitle, but constrained_layout does. See this question Improve subplot size/spacing with many subplots in matplotlib
I found adding the subplots at once looked better, i.e.
fig, axs = plt.subplots(rows, cols, constrained_layout=True)
# then iterating over the axes to fill in the plots
But it can also be added at the point the figure is created:
fig = plt.figure(constrained_layout=True)
ax1 = fig.add_subplot(cols, rows, 1)
# etc
Note: To make my subplots closer together, I was also using
fig.subplots_adjust(wspace=0.05)
and constrained_layout doesn't work with this :(