There are two colors in my head. But we’ll need a few more to make plots.
ggroove
is a package of color palettes and ggplot2 scale_
functions inspired by various album covers.
You can install the development version here
remotes::install_github("danovando/ggroove")
The first entries in the ggroove
library come from Radiohead’s studio LPs, which gets a series of specific functions in the form
scale_fill_radiohead_d
and scale_color_radiohead_c
, where _d
indicates discrete and _c
indicates continuous.
As other artists are added, you can use color palettes from any included album using
scale_fill_album_d
and scale_color_album_c
If you’d like to submit a color palette to ggroove
, see instructions here
A quick note, there’s a lot of science out there on how to construct color palettes that accurately convey information.
These are not those.
Color schemes that make for great album art are not necessarily designed to convey information. I wouldn’t recommend using these for continuous color scales, if you’ve got a few discrete categories rock on.
plot_palette(lp = "pablo_honey")
plot_palette(lp = "the_bends")
plot_palette(lp = "ok_computer")
plot_palette(lp = "kid_a")
plot_palette(lp = "amnesiac")
plot_palette(lp = "hail_to_the_thief")
plot_palette(lp = "in_rainbows")
plot_palette(lp = "the_king_of_limbs")
plot_palette(lp = "a_moon_shaped_pool")
We’ll use data from gapminder
and palmerpenguins
to demonstrate ggroove
.
library(ggplot2)
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
library(ggroove)
library(palmerpenguins)
library(gapminder)
ggplot2::theme_set(theme_minimal())
gapminder::gapminder %>%
ggplot(aes(lifeExp, fill = country)) +
geom_histogram(show.legend = FALSE) +
scale_fill_radiohead_d(album = "in_rainbows") +
theme_minimal()
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
gapminder::gapminder %>%
ggplot(aes(lifeExp, fill = continent)) +
geom_histogram(show.legend = FALSE) +
scale_fill_radiohead_d(album = "ok_computer") +
theme_minimal() +
theme_dark()
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
And some discrete penguins as well
penguins %>%
ggplot(aes(bill_length_mm, bill_depth_mm, color = species)) +
geom_point(size = 4) +
scale_color_radiohead_d(album = "in_rainbows", direction = 1)
#> Warning: Removed 2 rows containing missing values (geom_point).
Here’s a continuous colorramp based on The Bends (again, probably best not to use ggroove
for continuous scales!)
penguins %>%
ggplot(aes(bill_length_mm, bill_depth_mm, color = body_mass_g)) +
geom_point(size = 4) +
scale_color_radiohead_c(album = "the_bends", direction = -1)
#> Warning: Removed 2 rows containing missing values (geom_point).
You can view all the artists / albums currently present in ggroove
by examining the ggroove
database in ggroove::ggroove_db
ggroove_db$artist %>% unique()
#> [1] "radiohead" "the_beatles"
ggroove_db$album %>% unique()
#> [1] "in_rainbows" "ok_computer" "kid_a"
#> [4] "the_king_of_limbs" "amnesiac" "hail_to_the_thief"
#> [7] "the_bends" "pablo_honey" "a_moon_shaped_pool"
#> [10] "the_white_album"
At the moment, we only have one non-Radiohead artist / album in the package, but more to come!
gapminder::gapminder %>%
ggplot(aes(lifeExp, fill = continent)) +
geom_histogram(show.legend = TRUE, color = "black") +
scale_fill_album_d(album = "the_white_album") +
theme_minimal() +
theme_dark()
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
I’ve built this package mostly around ggplot2
users, but base plot users can use it too.
You can use the ggroove::album
function to generate a color palette based on your LP choice.
Code and concept for this package was adapted from the amazing fishualize
and wesanderson
packages.