Increase distance between title and plot in matplolib?

Vincent picture Vincent · May 7, 2013 · Viewed 64.3k times · Source

I have a simple plot in matplotlib and I would like to increase the distance between the title and the plot (without using suptitle because it does not work on the version I use on a server). How to do that ?

Answer

apdnu picture apdnu · Mar 20, 2018

With matplotlib 2.2+, you can use the keyword argument pad:

ax.set_title('Title', pad=20)

Adjust pad until you're happy with the axis title position. The advantage of this method over using rcParams is that it only changes this one axis title.