Vega-Lite Density Plot (KDE)

A kernel-density estimate (KDE) plot showing the smooth probability density of three groups overlaid on the same axis — a more honest distribution visual than a histogram (no bin-edge sensitivity). Vega-Lite's `density` transform handles the entire KDE computation: choose the fie

Template details

  • chart
  • density
  • kde
  • distribution
  • vega
  • vega-lite

When to use this template

This visualization makes it clear how continuous data is distributed, revealing its shape, peaks, and spread without the visual noise of histograms. Analysts use it to compare the underlying probability densities of a measurement across different categories or conditions, offering a nuanced view of group differences. It helps identify shifts in central tendency, variability, and skewness between groups.

  • Datasets with one continuous numerical variable.
  • Optional: one categorical variable for grouping comparisons.
  • Sufficient observations per group to estimate a smooth density.
  • Comparing the shape and spread of 2-5 distributions effectively.
  • Analyzing data where binning artifacts obscure true distribution.
  • Identifying subtle differences in distribution tails or modes.

Browse all Koan templates