Get the title of a given figure

There seems to be no public API to access this. But with some cautions you could use the non-public / potentially instable members:


Another solution would be to use fig.texts which returns a list of matplotlib.text.Text objects. Therefore, we can get the first element of the list, then use get_text() to get the actual title:

fig = plt.figure()
fig.suptitle("my title")

text = fig.texts[0].get_text()
# my title

You can get the title through the axes:


In case you have access to the axis itself, you can directly do: