Get Started →
Distribution CategoricalNumerical

Ridgeline Plot

ggplot2: geom_density_ridges() · Package: ggridges · Variables: 1 numerical + 1 categorical/ordinal

WHAT IS A RIDGELINE PLOT?

A ridgeline plot (also called a joy plot) stacks multiple density curves vertically with slight overlap, creating a mountain-range effect that makes it easy to compare distributions across many groups. It answers "how does the distribution of X shift across different categories or time periods?" Ridgeline plots are especially effective for 5-20 groups — far more than box plots can handle comfortably. They are popular in genomics, climate data, and any field where distribution shifts over an ordered variable are of interest. In R, use the ggridges package with geom_density_ridges().

BEST FOR

  • · Comparing distributions across many groups
  • · Distribution shifts over time
  • · Visually striking comparisons

AVOID WHEN

  • · Very few groups
  • · Precise distribution comparison needed
  • · Non-technical audience

R + GGPLOT2 CODE EXAMPLE

ggridges
library(ggridges)
ggplot(iris, aes(x = Sepal.Length, y = Species, fill = Species)) +
  geom_density_ridges(alpha = 0.7) +
  labs(title = "Sepal Length by Species", x = "Sepal Length") +
  theme(legend.position = "none")

Run this code now

Paste the code above into RChat and see the ridgeline plot rendered instantly in your browser.

Try RChat Free →

SIMILAR CHART TYPES

ALTERNATIVES FOR YOUR DATA TYPE