# Density Plot

**Category:** charts  
**Short Description:** A smoothed representation of the distribution of a numeric variable.  
**Last Updated:** 2026-05-30T00:00:00Z

## Definition

Density plots show the distribution of a numeric variable through a continuous curve, where the area under the curve represents the probability of the variable falling within a particular range. The plot is created by applying kernel density estimation to the data.

## Examples

- Distribution of measurement values for categories A and B

## FAQs

### What is a density plot?

A density plot displays the distribution of a continuous variable as a smooth curve, where the height of the curve shows how concentrated values are at each point and the area under the curve totals one. It's essentially a smoothed histogram — instead of discrete bars it draws a continuous line, making the overall shape (peaks, skew, multiple modes) easy to see without the jaggedness of bin edges.

### Density plot vs histogram — what's the difference?

A histogram bins data into bars whose heights are counts; a density plot smooths that into a continuous curve whose area integrates to one. Histograms are more literal and show actual counts but can look different depending on bin choices. Density plots reveal the underlying shape more cleanly and, crucially, let you overlay several distributions on the same axes to compare them — something overlapping histograms do poorly.

### When should I use a density plot?

Use one when the shape of a distribution matters and especially when comparing two or more groups, because semi-transparent density curves overlay cleanly where histograms would clash. They're great for showing how a metric's distribution differs across segments — session length by device, order value by cohort. For a single distribution where exact counts matter, a histogram may be more honest.

### How does bandwidth (smoothing) affect a density plot?

Bandwidth is the density plot's equivalent of bin width. Too small a bandwidth makes the curve wiggly and noisy, inventing peaks that aren't real; too large oversmooths it into a featureless hump that hides real structure like a second mode. As with histogram bins, try a few bandwidths and choose the one that shows genuine shape without exaggerating noise.

### Can a density plot mislead me?

Yes, in a couple of ways. Heavy smoothing can erase real features or imply data where there is none, and the curve can extend slightly beyond the actual data range (e.g. into negative values for a quantity that can't be negative). Density estimates also assume reasonably continuous data. Pair a density plot with a histogram or the raw points when accuracy matters, and watch the bandwidth.

## Related Terms

### Alternatives

- **[Histogram](/resources/glossary/charts/histogram)**: Shows frequency distribution using discrete bins
- **[Box Plot](/resources/glossary/charts/box-plot)**: Shows distribution summary using quartiles
