musculusColors
September 16, 2020 ยท View on GitHub
Blue whale inspired R color palette, with some gray whales thrown in there :)
The colors of our favorite whale species saved in R color palettes. Inspired by the images of the whales they study GEMM lab graduate students Dawn Barlow and Clara Bird have created this R color palette package.
The paletter package was used to extract color from images and structure of code was inspired by the PNWColors package.
Image Copyright GEMM Lab, Marine Mammal Institute, Oregon State University.
Gray whale images collected under NOAA/NMFS permit #16111 and #21678.
Table of Contents
Install
Running
Palettes
Example Plots
Install
# dev version
library(devtools)
devtools::install_github("dawnbarlow/musculusColors")
Running the package
library(musculusColors)
names(Bm_palettes)
[1] "Bmlunge" "Bmsurface" "Bmpoop" "ErFluke" "ErHead" "ErMole"
[7] "ErWhale"
Palettes
Blue Whales (Balaenoptera musculus)
musculus_palette("Bmlunge")
musculus_palette("Bmsurface")
musculus_palette("Bmpoop")
Gray Whales (Eschrichtius robustus)
musculus_palette("ErFluke")
musculus_palette("ErWhale")
musculus_palette("ErHead")
musculus_palette("ErMole")
Example Plots
library(hexbin)
ggplot(data.frame(x = rnorm(1e4), y = rnorm(1e4)), aes(x = x, y = y)) +
geom_hex() +
coord_fixed() +
scale_fill_gradientn(colours = musculus_palette("Bmlunge", n=50)) +
theme_classic()
ggplot(diamonds, aes(carat, fill = cut)) +
geom_density(position = "stack") +
scale_fill_manual(values=musculus_palette("Bmsurface",5, type = "discrete")) +
theme_classic()
ggplot(diamonds, aes(x=cut, y=carat, fill = cut)) +
geom_boxplot() +
scale_fill_manual(values=musculus_palette("Bmpoop", 5)) +
theme_classic()
ggplot(diamonds, aes(carat, fill = cut)) +
geom_density(position = "stack") +
scale_fill_manual(values=musculus_palette("ErFluke",5, type = "discrete")) +
theme_classic()
ggplot(diamonds, aes(x=cut, y=carat, fill = cut)) +
geom_boxplot() +
scale_fill_manual(values=musculus_palette("ErHead", 5)) +
theme_classic()
library(hexbin)
ggplot(data.frame(x = rnorm(1e4), y = rnorm(1e4)), aes(x = x, y = y)) +
geom_hex() +
coord_fixed() +
scale_fill_gradientn(colours = rev(musculus_palette("ErMole", n=50))) +
theme_classic()
ggplot(diamonds, aes(depth, carat,fill = cut)) +
geom_violin(trim=FALSE) +
scale_fill_manual(values=musculus_palette("ErWhale", 5)) +
theme_classic()
