-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
94 lines (65 loc) · 2.7 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
---
title: "Technocolour"
author:
- "Sophie Meakin"
date: "`r Sys.Date()`"
output:
md_document:
variant: markdown_github
toc: false
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE,
fig.path = "man/figures/")
library(ggplot2)
devtools::load_all()
```
# technocolour: colour palettes based on electronic music records
The [`technocolour`](https://sophiemeakin.github.io/technocolour/index.html) package contains colour palettes based on the album artwork some of my favourite electronic music records. Enjoy!
## Installation
You can install the package from Github:
```{r, eval = FALSE}
devtools::install_github("sophiemeakin/technocolour")
```
## Available palettes
```{r echo = FALSE, fig.width = 14, fig.height = 6}
par(mfrow = c(ceiling(length(list_palettes())/4), 4))
print_palette(palette = "bodied")
print_palette(palette = "esther")
print_palette(palette = "hotbot")
print_palette(palette = "ibrik")
print_palette(palette = "poodle")
print_palette(palette = "rush")
print_palette(palette = "x")
par(mfrow = c(1,1))
```
## Quick-start guide
### List available palettes
List the names of all available palettes with [`list_palettes()`](https://sophiemeakin.github.io/technocolour/reference/list_palettes.html); you can specify the type of palette (qualitative, sequential, or diverging) with the argument `type`:
```{r}
list_palettes()
```
### Visualise palettes
Preview a named palette with [`print_palette()`](https://sophiemeakin.github.io/technocolour/reference/print_palette.html):
```{r vis_palettes, fig.width=14, fig.height=3, dpi=400}
print_palette(palette = "esther")
```
### Using with ggplot2
Use [`scale_color_techno()`](https://sophiemeakin.github.io/technocolour/reference/scale_color_techno.html) and [`scale_fill_techno()`](https://sophiemeakin.github.io/technocolour/reference/scale_fill_techno.html) to use the palette in ggplot object:
```{r example1, fig.width = 12, fig.height = 6, dpi = 400}
ggplot(data = iris,
aes(x = Petal.Length, y = Petal.Width, col = Species)) +
geom_point(size = 3) +
scale_color_techno(palette = "rush") +
theme_bw() +
theme(legend.position = "top",
text = element_text(size = 14))
```
### Palette info
Print the track name, artist name and URL link for a named palette with [`info()`](https://sophiemeakin.github.io/technocolour/reference/info.html):
```{r}
info("poodle")
```
Please read the [package documentation](https://sophiemeakin.github.io/technocolour/reference/index.html) for full details.
## Contributing
Please add new palettes based on your favourite records! Check out our [contributing guide](https://sophiemeakin.github.io/technocolour/CONTRIBUTING.html) to find out how to get involved.