Ridgeline plots provide a convenient way of visualizing changes in distributions over time or space. This package enables the creation of such plots in 'ggplot2'.
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.
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.
Latest development version:
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` optionscale_x_continuous(expand = c(0, 0)) # for both axes to remove unneeded padding
alphaaesthetic is now by default applied to jittered points. If you don't want this to happen, set
point_alpha = 1.
quantile_fun = mean.
geom_density_line()which is a drop-in replacement for
geom_density()but draws a ridgeline rather than a closed polygon.
theme_ridges()has been modified so that font sizes match the cowplot themes. In particular, this means smaller axis tick labels.
binlinethat can be used to draw histogram joyplots.
stat_joy. In particular, it now works properly with multiple panels. It also now has parameters
toto limit the range of density estimation, just like
geom_joy_gradientthat can handle gradient fills.
First complete implementation ready for initial release