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 createdTextartist. Usesmatplotlib.pyplot.gcf()to locate the target figure.- Parameters:
text (str) – The title text.
**kwargs (Any) – Forwarded to
matplotlib.pyplot.suptitle()(e.g.,fontsize,y,fontweight).
- Returns:
The suptitle artist.
- Return type:
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')