publiplots.suptitle

publiplots.suptitle(text, **kwargs)[source]

Add a figure-level title to the current figure.

Thin wrapper around matplotlib.pyplot.suptitle() that also hooks into publiplots’ auto-layout engine: the figure grows vertically to reserve room for the title (no overlap with top-row axis titles), and repeated calls replace the prior suptitle rather than accumulating texts on the figure. Returns the created Text artist. Uses matplotlib.pyplot.gcf() to locate the target figure.

Parameters:
Returns:

The suptitle artist.

Return type:

matplotlib.text.Text

Examples

>>> import publiplots as pp
>>> fig, axes = pp.subplots(1, 2)
>>> pp.barplot(data=df1, x='x', y='y', ax=axes[0])
>>> pp.barplot(data=df2, x='x', y='y', ax=axes[1])
>>> pp.suptitle('Comparison of two experiments')