forked from karthik/wesanderson
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
152 lines (103 loc) · 3.15 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
[![Build Status](https://travis-ci.org/karthik/wesanderson.png)](https://travis-ci.org/karthik/wesanderson)
# Wes Anderson Palettes
![](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/)
```coffee
install.packages("wesanderson")
```
__Or the development version__
```coffee
devtools::install_github("karthik/wesanderson")
```
__Current list of available palettes__
```{r, echo = FALSE, message = FALSE}
knitr::opts_chunk$set(
comment = "#>",
error = FALSE,
tidy = FALSE,
fig.cap=""
)
```
```{r, palettes_dummy, eval = FALSE}
library(wesanderson)
namelist
```
```{r, palettes, echo = FALSE, results = "asis", message = FALSE}
library(pander)
library(wesanderson)
pandoc.table(namelist, style = "rmarkdown")
```
__See the palettes__
## Grand Budapest
```{r, grandbudapest, fig.height = 3}
display.wes.palette(4, "GrandBudapest")
display.wes.palette(4, "GrandBudapest2")
```
```{r, ggplot2, tidy = FALSE}
ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
geom_point(size = 3) +
scale_color_manual(values = wes.palette(3, "GrandBudapest")) +
theme_gray()
```
## Moonrise Kingdom
```{r, moonrise, fig.height = 3}
display.wes.palette(4, "Moonrise1")
display.wes.palette(4, "Moonrise2")
display.wes.palette(5, "Moonrise3")
```
## Royal Tannenbaums
```{r, royal, fig.height = 3}
display.wes.palette(4, "Royal1")
display.wes.palette(5, "Royal2")
```
```{r, ggplot1, tidy = FALSE}
qplot(factor(cyl), data=mtcars, geom="bar", fill=factor(vs)) +
scale_fill_manual(values = wes.palette(2, "Royal1"))
```
## Castello Cavalcanti
```{r, castello, fig.height = 3}
display.wes.palette(5, "Cavalcanti")
```
## Hotel Chevalier
```{r, chevalier, fig.height = 3}
display.wes.palette(4, "Chevalier")
```
## The Life Aquatic
```{r, lifeaquatic, fig.height = 3}
display.wes.palette(5, "Zissou")
```
```{r, volcano}
pal <- wes.palette(name = "Zissou", type = "continuous")
image(volcano, col = pal(21))
```
```{r, zissou_heatmap, tidy = FALSE}
library(wesanderson)
pal <- wes.palette(name = "Zissou", type = "continuous")
# heatmap is a local dataset
ggplot(heatmap, aes(x = X2, y = X1, fill = value)) +
geom_tile() +
scale_fill_gradientn(colours = pal(100)) +
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, fig.height = 3}
display.wes.palette(5, "Darjeeling")
display.wes.palette(5, "Darjeeling2")
```
## Fantastic Mr. Fox
```{r, fantasticfox, fig.height = 3}
display.wes.palette(4, "FantasticFox")
```
## Rushmore
```{r, rushmore, fig.height = 3}
display.wes.palette(4, "Rushmore")
```
## Bottle Rocket
Coming soon
---
## 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)