Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (45.3k 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 (16.8k 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.

Related questions

0 votes
1 answer
asked Nov 30, 2020 in Python by laddulakshana (16.4k points)
0 votes
1 answer
0 votes
1 answer
+2 votes
3 answers

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...