Ridgeline Plot
A cascade of overlapping density curves, stacked vertically — one per group — to compare how distributions shift, spread, or cluster across categories.
// 01 — The chart
What it looks like
A ridgeline plot showing how daily temperature distributions shift across five months. June and July show the widest, warmest spreads.
// 02 — Definition
What is a ridgeline plot?
A ridgeline plot (also called a joy plot) arranges multiple density curves vertically, slightly overlapping each other. Each curve represents the distribution of a single group or time period, and the vertical stacking makes it easy to spot shifts, widening, or bimodality across groups.
The power of a ridgeline plot lies in compact multi-group comparison. Where a faceted grid of histograms takes a lot of space, a ridgeline compresses the same information into a visually striking, easy-to-scan cascade. It trades some precision for a clear sense of pattern and trend.
Ridgeline plots are most effective when there is a natural ordering to the groups — such as time (months, years), geography (latitude), or a ranked category. The overlap lets you see how the distribution evolves along that ordering.
Origin: The name “joy plot” comes from the iconic cover of Joy Division’s 1979 album Unknown Pleasures, which showed stacked radio signal waveforms from pulsar CP 1919. The chart type was later renamed “ridgeline plot” to avoid associations with the band name’s problematic origins.
// 03 — Anatomy
Parts of a ridgeline plot
// 04 — Usage
When to use it — and when not to
- You need to compare distributions across 5–20 ordered groups
- Groups have a natural order (time, geography, rank)
- You want to see how a distribution shifts or widens over an axis
- Violin plots would take too much space for the number of groups
- Creating a visually striking, editorial-quality graphic
- Exploring temporal trends in weather, music, or sensor data
- Groups have no logical order — the stacking becomes arbitrary
- You only have 2–3 groups — use overlaid density plots instead
- Precise density values matter — overlap hides the baseline
- You have very few observations per group (<30) — curves will mislead
- The audience needs exact quantile values — use box plots
- Distributions are nearly identical — differences won't be visible
// 05 — Reading guide
How to read a ridgeline plot
Follow these steps when you encounter a ridgeline plot.
Read the group labels
Each row represents a different group. Identify the ordering — is it time, geography, or something else?
Trace the peaks
Follow the peak position from top to bottom. A shifting peak means the central tendency is changing across groups.
Compare widths
Wider curves mean more spread; narrower curves mean tighter clustering. Look for groups with unusually high or low variability.
Look for multimodality
Curves with two peaks (bimodal) suggest two distinct subpopulations within that group.
Note the overlap direction
Bottom rows partially hide behind top rows. If a critical comparison is obscured, consider reordering the groups.
// 06 — Data format
What your data should look like
A ridgeline plot needs a continuous numeric column and a categorical group column.
| month | temperature |
|---|---|
| Jun | 82 |
| Jun | 78 |
| Jul | 91 |
| Jul | 88 |
| Aug | 85 |
// R example (ggridges)
library(ggridges) ggplot(df, aes(x = temperature, y = month, fill = month)) + geom_density_ridges(alpha = 0.7)
// 07 — Construction
How to build a ridgeline plot
Compute a kernel density estimate (KDE) for each group
Decide on the vertical stacking order — typically chronological or geographic
Position each group's baseline at an even vertical interval
Draw each density curve upward from its baseline, with a fill
Allow curves to overlap the row above — typically 30–60% overlap
Add group labels on the left and a shared X-axis at the bottom
// 08 — Pitfalls
Common mistakes
Too much overlap
If curves overlap more than ~60%, important features get hidden. Reduce overlap or increase vertical spacing.
No meaningful group order
Random ordering defeats the purpose — the eye can't track a trend. Always order groups logically.
Inconsistent scales
All curves must share the same X-axis. Normalizing Y-axes across groups ensures fair visual comparison.
Too many groups
Beyond 20 groups, the chart becomes cluttered. Consider small multiples or a heatmap instead.
Opaque fills hiding curves
Fully opaque fills hide curves behind them. Use semi-transparent fills (alpha 0.5–0.8) or white-background fills with outlines.
// 09 — In the wild
Real-world examples
Showing how daily temperature distributions shift month-by-month or decade-by-decade to visualize warming trends.
Spotify data scientists used ridgeline plots to show how audio features (tempo, energy) of a genre evolved across decades.
Visualizing patient blood glucose readings across different treatment phases to see how the distribution tightens.
// 10 — At a glance
Quick reference
| Also known as | Joy plot, stacked density plot |
| Category | Distribution |
| Data type | One continuous variable + one categorical grouping variable |
| Axes | X = measurement, Y = groups (stacked vertically) |
| Ideal group count | 5–20 ordered groups |
| Key parameter | Overlap percentage between adjacent rows |
| Popularized by | Joy Division album cover (1979); named 'ridgeline' by Claus Wilke (~2017) |
// 11 — Accessibility
Accessibility notes
Ensure sufficient contrast between the curve fill and the background, and between adjacent rows
Use distinct hues or textures if color-coding groups — avoid relying on color alone
Provide a text summary for each group: 'June peaks at 85°F with a narrow spread'
Consider a faceted small-multiples layout as an accessible alternative
For screen readers, provide a data table with per-group summary statistics
// 12 — Variations
Variations
Gradient ridgeline
Color each curve with a gradient mapped to a secondary variable (e.g., temperature → blue-to-red).
Histogram ridgeline
Replace smooth density curves with step histograms for a more data-literal approach.
Ridgeline with rug
Add tick marks (a rug) below each curve showing individual data points.
Quantile ridgeline
Shade the area between the 25th and 75th percentiles within each curve for emphasis.
// 13 — FAQs
Frequently asked questions
What is a ridgeline plot?+
A ridgeline plot (also called a joy plot) arranges multiple density curves vertically, slightly overlapping each other. Each curve represents the distribution of a single group or time period, and the vertical stacking makes it easy to spot shifts, widening, or bimodality across groups.
When should you use a ridgeline plot?+
Use a ridgeline plot when you need to compare distributions across 5–20 ordered groups. It also works well when groups have a natural order (time, geography, rank), and when you want to see how a distribution shifts or widens over an axis.
When should you avoid a ridgeline plot?+
Avoid a ridgeline plot when groups have no logical order — the stacking becomes arbitrary. It is also a poor fit when you only have 2–3 groups — use overlaid density plots instead, or when precise density values matter — overlap hides the baseline.
What data do you need to make a ridgeline plot?+
A ridgeline plot needs a continuous numeric column and a categorical group column.
Are ridgeline plots accessible to screen readers?+
Yes — a ridgeline plot can be made accessible to screen readers by pairing it with a clear text summary of the key insight, ensuring color choices meet WCAG contrast guidelines, adding descriptive alt text or aria-label to the SVG, and offering the underlying data as an HTML table fallback for assistive technologies.
Is a ridgeline plot suitable for dashboards?+
Yes — a ridgeline plot can work well in dashboards as long as the panel is large enough for readers to perceive the encoded values, has a clear title, and includes the legend or axis labels needed to interpret it.