K C
K C

Reputation: 73

matplotlib: how to return figure suptitle

I know you can return the title of an axis with ax.get_title(), but I cannot find a way to return the suptitle of a matplotlib figure. Is there something along the lines of fig.get_suptitle()?

Upvotes: 6

Views: 2537

Answers (1)

ImportanceOfBeingErnest
ImportanceOfBeingErnest

Reputation: 339660

To get a figure fig's suptitle text object

sup = fig._suptitle

To get the string content of the suptitle

label = fig._suptitle.get_text()

Upvotes: 9

Related Questions