-
-
Notifications
You must be signed in to change notification settings - Fork 147
/
README.Rmd
171 lines (121 loc) · 3.49 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
---
output:
md_document:
variant: markdown_github
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "figure/",
fig.height = 1
)
```
# Wes Anderson Palettes
[![Build Status](https://travis-ci.org/karthik/wesanderson.png)](https://travis-ci.org/karthik/wesanderson)\
![CRAN Downloads](http://cranlogs.r-pkg.org/badges/wesanderson)
![](rushmore.jpg)
> I saved you from boring plots. What did you ever do? - Max Fischer (probably)
Tired of generic mass produced palettes for your plots? Short of adding an owl and dressing up your plot in a bowler hat, here's the most indie thing you can do to one. First round of palettes derived from the amazing Tumblr blog [Wes Anderson Palettes.](http://wesandersonpalettes.tumblr.com/)
## Installation
``` r
install.packages("wesanderson")
```
**Or the development version**
``` r
devtools::install_github("karthik/wesanderson")
```
## Usage
```{r, palettes_dummy}
library("wesanderson")
# See all palettes
names(wes_palettes)
```
## Palettes
### Bottle Rocket (1996)
```{r, bottlerocket1}
wes_palette("BottleRocket1")
wes_palette("BottleRocket2")
```
### Rushmore (1998)
```{r, rushmore}
wes_palette("Rushmore1")
```
### The Royal Tenenbaums (2001)
```{r, royal}
wes_palette("Royal1")
wes_palette("Royal2")
```
```{r, ggplot1, fig.height = 3}
library("ggplot2")
ggplot(mtcars, aes(factor(cyl), fill=factor(vs))) + geom_bar() +
scale_fill_manual(values = wes_palette("Royal1"))
```
### The Life Aquatic with Steve Zissou (2004)
```{r, lifeaquatic}
wes_palette("Zissou1")
```
```{r, volcano, fig.height = 3}
pal <- wes_palette("Zissou1", 21, type = "continuous")
image(volcano, col = pal)
```
```{r, zissou_heatmap, fig.height = 3}
pal <- wes_palette("Zissou1", 100, type = "continuous")
# heatmap is a local dataset
ggplot(heatmap, aes(x = X2, y = X1, fill = value)) +
geom_tile() +
scale_fill_gradientn(colours = pal) +
scale_x_discrete(expand = c(0, 0)) +
scale_y_discrete(expand = c(0, 0)) +
coord_equal()
```
### The Darjeeling Limited (2007)
```{r, darjeeling}
wes_palette("Darjeeling1")
wes_palette("Darjeeling2")
```
### Hotel Chevalier (2007)
```{r, chevalier}
wes_palette("Chevalier1")
```
### Fantastic Mr. Fox (2009)
```{r, fantasticfox}
wes_palette("FantasticFox1")
```
### Moonrise Kingdom (2012)
```{r, moonrise}
wes_palette("Moonrise1")
wes_palette("Moonrise2")
wes_palette("Moonrise3")
```
### Castello Cavalcanti (2013)
```{r, castello}
wes_palette("Cavalcanti1")
```
### The Grand Budapest Hotel (2014)
```{r, grandbudapest}
wes_palette("GrandBudapest1")
wes_palette("GrandBudapest2")
```
### The Isle of Dogs (2018)
```{r, isleofdogs}
wes_palette("IsleofDogs1")
wes_palette("IsleofDogs2")
```
### The French Distpatch (2021)
```{r}
wes_palette("FrenchDispatch")
```
### Asteroid City (2023)
```{r}
wes_palette("AsteroidCity1")
wes_palette("AsteroidCity2")
wes_palette("AsteroidCity3")
```
## As seen in these publications
- [The environmental niche of the global high seas pelagic longline fleet](http://advances.sciencemag.org/content/4/8/eaat3681) Science Advances 08 Aug 2018
![Imgur](https://i.imgur.com/gYKFwEc.jpg)
![Imgur](https://i.imgur.com/3Ztc5Qa.png)
- [Lopus, S., & Frye, M. (2018). Visualizing Africa's Educational Gender Gap. Socius: Sociological Research for a Dynamic World, 4, 237802311879595](http://journals.sagepub.com/doi/full/10.1177/2378023118795956)
![Imgur](https://i.imgur.com/0BVNi9g.jpg)