-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathREADME.Rmd
57 lines (42 loc) · 2.06 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-"
)
```
# ggridges: Ridgeline plots in ggplot2
<!-- badges: start -->
[](https://github.com/wilkelab/ggridges/actions)
[](https://app.codecov.io/github/wilkelab/ggridges?branch=master)
[](https://CRAN.R-project.org/package=ggridges)
[](https://cranlogs.r-pkg.org/downloads/total/last-month/ggridges)
[](https://lifecycle.r-lib.org/articles/stages.html#maturing)
<!-- badges: end -->
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:
```{r eval = FALSE}
install.packages("ggridges")
```
Alternatively, you can install the latest development version from github:
```{r eval = FALSE}
remotes::install_github("wilkelab/ggridges")
```
## Usage
```{r diamonds, warning = FALSE}
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()
```
## Documentation and Examples
First read the [package vignette.](https://wilkelab.org/ggridges/articles/introduction.html) Then read the [reference manual.](https://wilkelab.org/ggridges/reference/index.html)