StatFAS · Density Plot Calculator

Density Plot Explained: Meaning, Interpretation and How to Make One in SPSS, R and Python

By the StatFAS team · Published 2026-11-07 · 7 min read

A density plot draws a smooth curve that shows how values of a variable are distributed. This guide explains what a density plot is, when a density plot beats a histogram, how to read peaks, spread, skew and overlap, and how to create a density plot in SPSS, R, Python or free online.

Draw a density plot online
Paste grouped data and get an editable density plot with Shapiro–Wilk, Welch tests and APA 7 text.
Open the free density plot calculator

What is a density plot?

A density plot (also called a kernel density plot or KDE plot) is a smoothed version of a histogram. Instead of counting observations in bins, a density plot places a small bell-shaped kernel on every observation and adds the kernels together. The resulting curve shows where values are concentrated: high parts of the density plot mark common values, low parts mark rare values. The total area under the curve equals 1, so the vertical axis shows density, not counts or percentages.

When should you use a density plot?

  • Comparing groups. Overlaid density plots reveal differences in centre, spread and shape at a glance.
  • Checking shape before testing. A density plot exposes skewness and bimodality that summary statistics hide.
  • Large samples. With 50 or more observations per group a density plot is smoother and easier to read than a histogram.
  • Before an ANOVA or t test. Overlap and unequal spread point to the Welch versions of these tests.
  • Continuous variables such as blood pressure, yield, reaction time or test scores.

Why choose a density plot over a histogram?

The shape of a histogram changes with bin width and bin start. A density plot removes the bin choice and overlays several groups cleanly, while overlaid histograms become unreadable. The price is a different tuning choice, the bandwidth, which controls smoothness. For small samples (under about 20 per group) a dot plot or a histogram can be more honest, because a density plot may suggest structure that the data do not support.

How to interpret a density plot

Feature of the density plotInterpretation
Location of the peak (mode)Most common value; compare peaks across groups for differences in centre
Width of the curveSpread; a wide, low curve means high variability
Long tail to the right or leftPositive or negative skew; the mean is pulled toward the tail
Two or more peaksBimodality, often a mixture of subgroups
Overlap between curvesLarge overlap means groups are not well separated, even when a test is significant
Mean line inside the peakRoughly symmetric data; a mean line far from the peak signals skew

Remember that areas, not heights, represent proportions. Density values can exceed 1 when the data range is narrow. Curves also extend beyond the observed minimum and maximum because of smoothing, so never read the tail as evidence of values that do not exist. Overlapping curves with unequal heights often reflect unequal spread, which the Brown–Forsythe test checks formally.

Common mistakes with a density plot

  • Accepting the default bandwidth for a tiny sample, which produces misleading bumps (too little smoothing) or hides real peaks (too much smoothing).
  • Reading the vertical axis as a probability or a count.
  • Plotting more than four or five groups on one density plot.
  • Using a density plot for discrete or heavily rounded data.
  • Judging group differences from the density plot alone without a test and an effect size.

How to report a density plot in APA 7

Example: Distributions were visualised using Gaussian kernel density estimates (Figure 1). A Welch one-way ANOVA revealed a significant effect of group, F(2, 197.21) = 2923.24, p < .001, η² = .95. Add the group means and standard deviations in a table, and state the bandwidth rule used.

How to make a density plot in SPSS, R and Python

SPSS

SPSS Statistics has no one-click kernel density command, so choose one of two routes.

  1. Quick look: Graphs → Chart Builder → Histogram shows the distribution, and Analyze → Descriptive Statistics → Explore → Plots adds histograms by group.
  2. True density curve: use the R integration inside SPSS (requires the R plug-in), shown below, or use the StatFAS density plot calculator.

R

R
library(ggplot2)
ggplot(df, aes(Value, fill = Group)) +
  geom_density(alpha = 0.4)

Python

Python
import seaborn as sns
sns.kdeplot(data=df, x="Value", hue="Group", fill=True, alpha=0.4)

Full scripts including group tests are in the density plot tutorial.

The easy way: density plot on StatFAS.com

The free density plot calculator draws the density plot with group colours, mean lines and optional rug marks, tests normality per group, compares groups with Welch tests and Holm-adjusted pairwise comparisons, and writes the APA 7 results. Bandwidth, colours, fonts and labels are editable, and signed-in visitors can download everything as one Word report.

Draw a density plot online
Paste grouped data and get an editable density plot with Shapiro–Wilk, Welch tests and APA 7 text.
Open the free density plot calculator

Frequently asked questions about the density plot

What does a density plot show?

A density plot shows the distribution of a continuous variable as a smooth curve; high regions mark common values and the area under the curve equals 1.

What is the difference between a density plot and a histogram?

A histogram counts values in bins, while a density plot smooths the data with kernels, removing the bin choice and making overlays of several groups readable.

What is bandwidth in a density plot?

Bandwidth controls the smoothness of the density plot. Small values give a bumpy curve, large values give an over-smoothed curve; Silverman’s rule is a common default.

Can a density plot have values above 1?

Yes. Density is not a probability, so heights above 1 occur when the data are tightly concentrated.

How many observations does a density plot need?

At least 20 to 30 per group gives a reliable density plot; with fewer observations, prefer a dot plot.