Learn R Programming

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

ggridges

Geoms to make ridgeline plots using ggplot2, written by Claus O. Wilke

This package has now been officially relased on CRAN. Most things should work as expected, and the API should now be relatively stable. For feedback and feature requests, please open issues on github.

About ridgeline plots

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. These types of plots have also been called "joyplots", in reference to the iconic cover art for Joy Division's album Unknown Pleasures. However, given the unfortunate origin of the name Joy Division, the term "joyplot" is now discouraged.

Installation

Stable release:

install.packages("ggridges")

Latest development version:

library(devtools)
install_github("clauswilke/ggridges")

Usage

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

Documentation and Examples

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

Copy Link

Version

Install

install.packages('ggridges')

Monthly Downloads

81,861

Version

0.5.0

License

GPL-2 | file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

April 5th, 2018

Functions in ggridges (0.5.0)

scale_point

Scales for point aesthetics
position_points_jitter

Randomly jitter the points in a ridgeline plot
position_points_sina

Randomly distribute points in a ridgeline plot between baseline and ridgeline
Catalan_elections

Results from Catalan regional elections (1980-2015)
scale_vline

Scales for vline aesthetics
geom_density_line

Smoothed density estimates drawn with a ridgeline rather than area
geom_density_ridges

Create ridgeline plot
geom_ridgeline

Plot a ridgeline (line with filled area underneath)
geom_ridgeline_gradient

Plot ridgelines and ridgeline plots with fill gradients along the x axis
position_raincloud

Create a cloud of randomly jittered points below a ridgeline plot
scale_cyclical

Create a discrete scale that cycles between values
scale_discrete_manual

Generic discrete manual scale
ggridges

Ridgeline plots with ggplot2
stat_binline

Stat for histogram ridgeline plots
reduce

Reduce a list to a single value by iteratively applying a binary function
lincoln_weather

Weather in Lincoln, Nebraska in 2016.
geom_vridgeline

Plot a vertical ridgeline (ridgeline rotated 90 degrees)
stat_density_ridges

Stat for density ridgeline plots
theme_ridges

A custom theme specifically for use with ridgeline plots