Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Giving graphs a subtitle in matplotlib

Tags:

matplotlib

I want to give my graph a title in big 18pt font, then a subtitle below it in smaller 10pt font. How can I do this in matplotlib? It appears the title() function only takes one single string with a single fontsize attribute. There has to be a way to do this, but how?

like image 238
priestc Avatar asked Sep 07 '09 09:09

priestc


People also ask

How do you put subtitles on a graph?

Choose Tools > Options > Graphics > Annotation > My Footnote and select the items that you want to include. To specify the title and add subtitles or footnotes when you create a graph: in the dialog box for the graph you are creating, click Labels.

How do you plot a subtitle in Python?

The shortest answer to your subtitle question is: There is a built-in suptitle() function. Thus, combining suptitle()/title() is similar to the more intuitively named title()/subtitle() .


1 Answers

What I do is use the title() function for the subtitle and the suptitle() for the main title (they can take different font size arguments). Hope that helps!

like image 89
Floris van Vugt Avatar answered Sep 16 '22 21:09

Floris van Vugt