0 votes
1 view
in Python by (7.9k points)

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 ?

1 Answer

0 votes
by (15.5k points)

There doesn't seem to be a clean way to set this directly (but might be worth a feature request to add that), however the title is just a text artist, so you can reach in and change it.

#ax = plt.gca()

ttl = ax.title

ttl.set_position([.5, 1.05])

#plt.draw()

should do the trick. Tune the 1.05 to your liking.

...