r4ds/rmarkdown-demos/1-example.Rmd

26 lines
449 B
Plaintext
Raw Normal View History

2016-08-19 01:40:09 +08:00
---
title: "Viridis Demo"
output: html_document
---
2016-08-23 00:01:59 +08:00
```{r setup, include = FALSE}
2016-08-19 01:40:09 +08:00
library(viridis)
```
2016-08-22 22:31:17 +08:00
The code below demonstrates two color palettes in the
[viridis](https://github.com/sjmgarnier/viridis) package.
Each plot displays a contour map of the Maunga Whau volcano
in Auckland, New Zealand.
2016-08-19 01:40:09 +08:00
## Viridis colors
```{r}
image(volcano, col = viridis(200))
```
## Magma colors
```{r}
image(volcano, col = viridis(200, option = "A"))
```