Charts & Visualizations

Density Plot

A smoothed representation of the distribution of a numeric variable.

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

Chart Visualization

This example includes an interactive chart visualization with 12 data points.

Chart type: density

Usage

Best Used For

  • Visualizing the shape of continuous data distributions
  • Comparing multiple distributions on the same scale
  • Identifying modes (peaks) and skewness
  • Smoother alternative to histograms

Data Requirements

[Object]

Limitations

Important Considerations

  • Appearance depends on kernel and bandwidth selection
  • Can smooth over fine details or gaps present in histograms
  • Requires sufficient data points for accurate estimation
  • Interpretation of the Y-axis (density) can be less intuitive than frequency (histogram)

Best Used For

  • Visualizing the shape of continuous data distributions
  • Comparing multiple distributions on the same scale
  • Identifying modes (peaks) and skewness
  • Smoother alternative to histograms

Frequently asked questions

Common questions about Density Plot, answered.

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

Histogram

Related term

charts, alternative

Box Plot

Related term

charts, alternative