⚠️There's a newer version (0.5.6) of this package. Take me there.

ggridges: Ridgeline plots in ggplot2

Ridgeline plots are partially overlapping line plots that create the impression of a mountain range. They can be quite useful for visualizing changes in distributions over time or space.

Installation

Please install the stable release from CRAN:

install.packages("ggridges")

Alternatively, you can install the latest development version from github:

remotes::install_github("wilkelab/ggridges")

Usage

library(ggplot2)
library(ggridges)
    
ggplot(diamonds, aes(x = price, y = cut)) +
  geom_density_ridges(scale = 4) + 
  scale_y_discrete(expand = c(0, 0)) +     # will generally have to set the `expand` option
  scale_x_continuous(expand = c(0, 0)) +   # for both axes to remove unneeded padding
  coord_cartesian(clip = "off") + # to avoid clipping of the very top of the top ridgeline
  theme_ridges()
#> Picking joint bandwidth of 458

Documentation and Examples

First read the package vignette. Then read the reference manual.

Copy Link

Version

Down Chevron

Install

install.packages('ggridges')

Monthly Downloads

85,672

Version

0.5.4

License

GPL-2 | file LICENSE

Maintainer

Last Published

September 26th, 2022

Functions in ggridges (0.5.4)