Suppose I have the following Seaborn FacetGrid plot using sns.lmplot()
:
import seaborn as sns
import matplotlib.pyplot as plt
from palmerpenguins import load_penguins
df = load_penguins()
g = sns.lmplot(
data=df, x="bill_length_mm", y="bill_depth_mm",
col="species", row="sex", height=3,
)
plt.show()
How can I include a title and subtitle for the entire figure? Thanks to this question and this question I know I can add a title by including something like this:
g.fig.suptitle("Palmer's Penguins", x = 0.5, y = 1.1, fontsize = 16)
But neither of these questions address how to include a subtitle in addition to the title. If possible, I would prefer to stick with an object-oriented approach (for example, if there were something like g.fig.subtitle()
) as opposed to a more generalized PyPlot approach (like something that might use plt.title()
).