-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
183 lines (123 loc) · 3.76 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
172
173
174
175
176
177
178
179
180
181
182
183
---
output: github_document
---
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "fig/README-",
echo = TRUE, fig.height = 1, fig.width = 6
)
```
# 'suffrager': a feminist colour palette for R
## Installation
```{r, eval=FALSE}
library(devtools)
install_github("alburezg/suffrager")
```
## Usage
```{r}
library(suffrager)
```
See all available palettes:
```{r}
names(suf_palettes)
```
## Palettes
### 1. London Society (from Mary Lowndes Album)
![](sources/pal1.jpg){width=600px}
```{r}
# Discrete
suf_palette("london")
```
### Example
```{r fig.width=7, fig.height=3}
library(ggplot2)
data(airquality)
ggplot(airquality, aes(x=Day, y=Month)) +
geom_tile(aes(fill=Temp)) +
scale_fill_gradientn(colours = rev(suf_palette("london", 30, type = "continuous"))) +
coord_equal()
```
### 2. Oxon Berks Bucks Federation: Never a Step Backward
![](sources/pal2.jpg){width=600px}
```{r}
# Discrete
suf_palette("oxon")
```
### Example
```{r fig.width=7, fig.height=6}
data(diamonds)
ggplot(diamonds, aes(x=carat, y=price, colour=cut)) +
geom_point() +
scale_colour_manual(values = suf_palette("oxon"))
```
### 3. Caroline & Manchester
![](sources/pal3.jpg){width=600px}
```{r}
# Discrete
suf_palette("CarolMan")
```
### Example
```{r fig.width=7, fig.height=6}
data(iris)
ggplot(iris,aes(x = Petal.Length, fill = Species)) +
geom_density() +
scale_color_manual(values = suf_palette("CarolMan"))
```
### 4. Hanwell Women's Institute
![](sources/pal4.jpg){width=600px}
```{r}
# Discrete
suf_palette("hanwell")
```
### Example
```{r fig.width=7, fig.height=6}
data(diamonds)
ggplot(diamonds, aes(x = carat, fill = cut)) +
geom_histogram(bins = 20) +
scale_fill_manual(values = rev(suf_palette("hanwell")))
```
### 5. Chelsea & St George
![](sources/pal5.jpg){width=600px}
```{r}
# Discrete
suf_palette("chelsea")
```
### Example
```{r fig.width=7, fig.height=6}
data("airquality")
ggplot(airquality, aes(x = factor(Month), y = Ozone, fill = factor(Month))) +
geom_violin() +
scale_fill_manual(values = suf_palette("chelsea"))
```
### 6. Classic suffragette
![](sources/pal6.jpg){width=600px}
```{r}
# Discrete
suf_palette("classic")
```
### Example
```{r fig.width=7, fig.height=6}
data(iris)
ggplot(iris,aes(x = Petal.Length, y = Petal.Width, color = Species)) +
geom_point() +
geom_smooth(method = 'loess') +
facet_grid(. ~ Species, scales = 'free') +
scale_color_manual(values = suf_palette("classic", n = 3, type = "continuous"))
```
Create a continuous palette of length `n` based on the suffragette colours:
```{r}
# Continuous
suf_palette("classic", n = 6, type = "continuous")
```
## Acknowledgements
Developed by [Diego Alburez-Gutierrez](http://www.alburez.me) and [Valentina Iemmi](http://personal.lse.ac.uk/iemmi/).
The package's architecture and documentation was taken from Karthik Ram's [wesanderson package](https://github.com/karthik/wesanderson).
Images for the `london`, `oxon`, `CarolMan`, `chelsea`, and `classic` palettes used with kind permission from the [LSE Womens Library Collection](http://www.lse.ac.uk/library/collections/collection-highlights/womens-suffrage).
Images for palette `hanwell` were provided by the [100 Banners project](http://www.digitaldrama.org/100-banners-images/) and are used with the project's consent. The [banners](https://collections.museumoflondon.org.uk/online/object/91873.html) for the `chelsea` pallete come from the collections of the Museum of London, as well as the [rosette](https://collections.museumoflondon.org.uk/online/object/87712.html) used for the `classic` palette.
Want to help? Create a pull request or share the word: @[d_alburez](https://twitter.com/d_alburez) @[ValentinaIemmi](https://twitter.com/ValentinaIemmi)!