How to add margin titles to a relplot

732 Views Asked by At

Seaborn's FacetGrid has a margin_titles kwarg, and its effect is shown in the documentation e.g.

enter image description here

How do I similarly add margin titles when using Seaborn's relplot?

1

There are 1 best solutions below

0
bert wassink On BEST ANSWER

I am not sure how you want to use it, but this can be given in a dict in the facet_kws argument.

import seaborn as sns
tips = sns.load_dataset("tips")

sns.relplot(
    data=tips,
    x="total_bill",
    y="tip",
    hue="time",
    col="day",
    row="smoker",  
    facet_kws={"margin_titles": True}
)

enter image description here