forked from karthik/wesanderson
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
146 lines (102 loc) · 2.79 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
---
---
<!-- 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_palette)
```
### Grand Budapest
```{r, grandbudapest, fig.height = 3}
library(ggplot2)
ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
geom_point(size = 3) +
scale_color_manual(values = wes_palette("GrandBudapest")) +
theme_gray()
```
## Moonrise Kingdom
```{r, moonrise}
wes_palette("Moonrise1")
wes_palette("Moonrise2")
wes_palette("Moonrise3")
```
## Royal Tannenbaums
```{r, royal}
wes_palette("Royal1")
wes_palette("Royal2")
```
```{r, ggplot1, fig.height = 3}
qplot(factor(cyl), data=mtcars, geom="bar", fill=factor(vs)) +
scale_fill_manual(values = wes_palette("Royal1"))
```
## Castello Cavalcanti
```{r, castello}
wes_palette("Cavalcanti")
```
## Hotel Chevalier
```{r, chevalier}
wes_palette("Chevalier")
```
## The Life Aquatic
```{r, lifeaquatic}
wes_palette("Zissou")
```
```{r, volcano, fig.height = 3}
pal <- wes_palette("Zissou", 21, type = "continuous")
image(volcano, col = pal)
```
```{r, zissou_heatmap, fig.height = 3}
pal <- wes_palette("Zissou", 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()
```
## Darjeeling Limited
![](http://i.imgur.com/Z2nJvOG.jpg)
```{r, darjeeling}
wes_palette("Darjeeling")
wes_palette("Darjeeling2")
```
## Fantastic Mr. Fox
```{r, fantasticfox}
wes_palette("FantasticFox")
```
## Rushmore
```{r, rushmore}
wes_palette("Rushmore")
```
## Bottle Rocket
```{r, bottlerocket}
wes_palette("BottleRocket2")
```
---
## Gallery of examples
* [Reading Secure Data Into R from Dropbox](http://aaronbaggett.com/notes/2014/03/28/reading-secure-data-into-r-from-dropbox/)
![](http://i.imgur.com/rKqbzQB.png)