Density plotThe smooth shape of your data.
A smooth hill instead of blocky bars. Where the curve is high, many values sit; where it is low, few do.
- Answers How are the values spread?
- Your data many values of one number
- Values about 30 or more
- Groups 1 to 4 on one chart
- Excel and Power BI not built in
- Shop A
- Shop B
What is a density plot?
A density plot draws one smooth curve over the range of one number. The curve is high where many values sit and low where few do, so it shows the same shape as a histogram without the blocks. Because the curves are thin, two or three groups can overlap on one chart and still be read.
The same pizza place now compares two shops. Shop A's curve peaks at about 35 minutes with a long tail; Shop B's peaks earlier and falls away faster.
Why use a density plot?
Because a smooth line shows the shape without the noise of bins.
- No bin width to pick. The shape does not jump when the bins change.
- Groups overlap well. Two curves on one chart compare at a glance.
- Shows the peaks. One hill or two, and where each one sits.
- Calm to look at. A clean shape for a slide or a report.
How does a density plot work?
Four steps turn values into a smooth hill.
- Step 1 of 4The valuesForty delivery times as dots on one line.
- Step 2 of 4A bump per valueCount them in ranges, like a histogram.
- Step 3 of 4Add up the bumpsEach value adds a small smooth bump; added up they make one curve.
- Step 4 of 4Read the shapeHigh where values bunch up, low where they are rare.
The curve's area adds up to the whole, so its height is a share, not a count. Compare heights within one chart, not across charts.
What are the parts of a density plot?
Four parts, and each one has a job.
- Curvehow common each value is
- Peakthe most common value
- Tailthe rare values far from the peak
- Value axisthe number being measured
How do you read a density plot?
Three looks, in this order.
- Find each peakShop B peaks near 27 minutes, Shop A near 35.
- Shop A
- Shop B
- Compare the widthsShop A is wider: its times vary more.
- Shop A
- Shop B
- Look at the tailsShop A's tail runs to 85 minutes; Shop B's stops near 50.
- Shop A
- Shop B
What kinds of density plot are there?
The same two shops, drawn three ways.
- Kind 1OverlappingBoth curves on one axis, for a direct compare.
- Shop A
- Shop B
- Kind 2One group litThe other in the background, to tell one story.
- Shop A
- Shop B
- Kind 3As ridgesOne curve per row, for many groups.
When should you use a density plot?
When you want the shape of one number, or to compare it across a few groups.
- there are many values (about 30 or more)
- the shape matters
- two to four groups are compared
- the reader knows the shape is smoothed
- exact counts matter (a histogram)
- there are few values (a strip plot)
- many groups are compared (ridgeline or box plots)
Density plot or histogram?
A density plot for the smooth shape, a histogram for the counts.
The histogram gives exact counts per bin, but its shape depends on the bin width. The density plot gives a smooth shape with no bins, but its height is not a count, and its smoothing can draw a little curve past the real values.
How do you make a density plot?
Not built into Excel or Power BI; easy in Python or R.
In Python, seaborn's kdeplot draws one from a column of numbers; in R, geom_density in ggplot2 does the same. In Power BI, a Python or R visual runs that code inside the report, as shown in Python and R visuals in Power BI. In Excel, a histogram is the built-in way to see the same shape.
What goes wrong with density plots?
The most common mistake, and its fix: smoothing too much or too little.
- too much smoothing melts two peaks into one
- too little turns every value into a spike
- start with the tool's default
- check the shape against a histogram
- say that the curve is smoothed
| Mistake | Why it hurts | Fix |
|---|---|---|
| Too much or too little smoothing | Peaks vanish or noise appears | The default, checked against a histogram |
| Reading the height as a count | It is a share of the whole | Say "share" or add a histogram |
| A curve past the real values | Shows values that cannot happen (below zero) | Cut the curve at the real limits |
| Too few values | The shape is chance | About 30 values or more |
| Too many groups overlapping | The curves tangle | Ridgeline or small multiples |
Every chart for “How are the values spread?”
- One groupHistogramTouching bars that count how many values fall in each range.
- One groupStrip plotEvery value as a dot along one line.
- One groupBeeswarm plotDots that push apart instead of overlapping, so every value shows.
- Comparing groupsBox plotThe middle half as a box, the median as a line, the rest as whiskers.
- Comparing groupsViolin plotA box plot with the shape of the values drawn around it.
- Comparing groupsRidgeline plotDensity curves stacked and overlapping, one per group.
- Comparing groupsRaincloud plotHalf a violin, a box and the dots, in one picture.
- Comparing groupsPopulation pyramidTwo histograms back to back, by age and sex.
- CumulativeCumulative distributionA rising line of the share of values at or below each point.
- CumulativePareto chartBars from biggest to smallest with a running total line.
- Fit checkQ-Q plotDots along a line when the data fits the shape you expect.
Read on, step by step.
Does it fit your data? Try it.
Paste your table into Chart Compass, say what the chart should show, and see the charts that fit, drawn with your own numbers. It runs in your browser, so the data stays with you.