Skip to content

wilkelab/ggridges

Folders and files

NameName
Last commit message
Last commit date

Latest commit

344e40f · Dec 11, 2024
Dec 11, 2022
Dec 11, 2024
Jan 11, 2020
Jan 11, 2020
Jan 23, 2024
Feb 7, 2024
Feb 7, 2024
Nov 27, 2022
Sep 22, 2022
Aug 10, 2017
Jul 10, 2017
Dec 11, 2024
May 13, 2018
Jul 10, 2017
Nov 27, 2022
Dec 11, 2024
Dec 14, 2023
Dec 14, 2023
Jan 11, 2020
Jan 11, 2020
Jan 23, 2024
Sep 13, 2017

Repository files navigation

ggridges: Ridgeline plots in ggplot2

R build status Coverage Status CRAN_Status_Badge CRAN_Downloads_Badge Lifecycle: maturing

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.