sns.relplot is the figure-level version of scatter/line. Its superpower is faceting: split the data into a grid of small panels — one per category — so you compare subgroups side by side.
Faceting with col/row
sns.relplot(data=tips, x="total_bill", y="tip",kind="scatter", # or "line"col="time", # a column of panels per 'time'row="sex", # a row of panels per 'sex'hue="smoker",)
Why facet?
Key takeaways
- 01relplot is the figure-level scatter/line — choose with kind="scatter"/"line".
- 02col= and row= split data into a grid of comparable panels (faceting).
- 03col_wrap wraps many panels; shared axes make groups comparable.
- 04relplot returns a FacetGrid, so customise via the returned object.
