sns.displot is the figure-level distribution function — it wraps histplot/kdeplot/ecdfplot and adds faceting. It also handles bivariate distributions: the joint density of two variables.
Faceted distributions
sns.displot(data=penguins, x="flipper_length_mm",kind="hist", # or "kde", "ecdf"col="species", # a panel per specieshue="sex")
Two variables at once
sns.displot(data=penguins, x="bill_length_mm", y="bill_depth_mm") # 2-D histsns.displot(data=penguins, x="bill_length_mm", y="bill_depth_mm", kind="kde") # 2-D KDE contours
Key takeaways
- 01sns.displot is the figure-level distribution function (kind = hist/kde/ecdf).
- 02col=/row= facet distributions into comparable panels.
- 03Passing both x and y draws a bivariate (2-D) distribution.
- 04A 2-D hist is a count heatmap; a 2-D KDE draws density contours.
