Skip to main content
Albero Academy

ECDF & Rug Plots

Distribution views that make no binning or smoothing choices.

Distribution Plots7 min

Histograms need a bin choice; KDEs need a bandwidth. The ECDF needs neither — it plots the exact cumulative proportion of data at or below each value, showing the full distribution with no tuning.

The empirical CDF

ecdfplot
sns.ecdfplot(data=penguins, x="flipper_length_mm", hue="species")
# y goes 0→1: the fraction of observations ≤ x

Read it directly: the y-value at any x is "what fraction of the data is at most this?". Medians (y=0.5) and percentiles are read straight off, and overlapping groups stay legible.

Rug plots

show every observation
sns.histplot(data=penguins, x="flipper_length_mm")
sns.rugplot(data=penguins, x="flipper_length_mm") # tick per observation on the axis

Key takeaways

  1. 01sns.ecdfplot shows the cumulative proportion ≤ each value — no bins or bandwidth needed.
  2. 02Read medians and percentiles straight off the y-axis; overlapping groups stay clear.
  3. 03sns.rugplot adds a tick per observation along an axis.
  4. 04ECDF is great for exact, artefact-free distribution comparison.

Finished this chapter?

Mark it complete to track your progress through Seaborn.