Skip to main content
Albero Academy

KDE Plots

Smooth density estimates — and their one big caveat.

Distribution Plots8 min

A kernel density estimate (sns.kdeplot) draws a smooth curve approximating the distribution — easier to compare across groups than jagged histograms, since overlapping curves read cleanly.

Smooth densities

kdeplot
sns.kdeplot(data=penguins, x="flipper_length_mm", hue="species")
sns.kdeplot(data=penguins, x="flipper_length_mm", hue="species",
fill=True, alpha=0.4) # shaded
sns.kdeplot(data=penguins, x="bill_length_mm", y="bill_depth_mm") # 2-D density

The smoothing caveat

Key takeaways

  1. 01sns.kdeplot draws a smooth density curve — great for comparing shapes across groups.
  2. 02fill=True shades under the curve; a 2-D KDE (x and y) shows joint density.
  3. 03bw_adjust controls smoothing — too much hides structure, too little adds noise.
  4. 04For small or bounded data, a histogram is more honest than a KDE.

Finished this chapter?

Mark it complete to track your progress through Seaborn.