knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
A ggplot2 color palette based on Phish Album Covers.
You can install the released version of fromthebottom with:
devtools::install_github("https://github.com/bradweiner/fromthebottom")
library(tidyverse) library(palmerpenguins) library(fromthebottom) penguins <- palmerpenguins::penguins %>% tidyr::drop_na()
Color by discrete variable using default palette based on Rift
ggplot(penguins, aes(bill_depth_mm, bill_length_mm, color = species)) + geom_point(size = 4) + scale_color_phish(palette = "rift")+ theme_void()
Junta looks great in grayscale
ggplot(penguins, aes(bill_depth_mm, bill_length_mm, color = species)) + geom_point(size = 3) + scale_color_phish(palette = "junta")+ theme_void()
Run like an antelope with Lawn Boy
ggplot(penguins , aes(bill_depth_mm, bill_length_mm,color = bill_length_mm)) + geom_point(size = 4) + scale_color_phish(discrete = FALSE, palette ="lawn_boy")+ theme_void()
Don't take another step with Hoist
ggplot(mpg, aes(manufacturer, fill = manufacturer)) + geom_bar() + theme_void()+ theme(axis.text.x = element_text(angle = 45, hjust = 1)) + scale_fill_phish(palette = "hoist", guide = "none")
Or, wade in the velvet sea with Ghost
ggplot(penguins, aes(species, fill = species)) + geom_bar() + theme_void()+ theme(axis.text.x = element_text(angle = 45, hjust = 1)) + scale_fill_phish(palette = "ghost", guide = "none")
junta
= "#E8EBEC","#161A19","#9BA2A4","#737374","#86898F"
lawn_boy
= "#30412A", "#758588", "#F55C17", "#F5DE2A", "#A44E23", "#F8A511", "#D06627", "#B9C5CB"
picture_of_nectar
= "#48204A", "#F1D06C", "#EEA122", "#A64535", "#D0671E", "#E48430", "#3E408F", "#E4E9D2"
rift
= "#2A365A", "#3A5A98", "#978C6E", "#4E81BF", "#989EAD", "#6694CD", "#ADB3C0", "#BEC2CA"
hoist
= "#DA4E49", "#E35541", "#D45490", "#7E3F24", "#9D6132", "#ACA34F", "#D6A25F", "#E7D6C7"
billy_breathes
= "#555450", "#F7F7F7", "#A8A6A4", "#8D8A86", "#CFCFCE", "#BDBDBA", "#E5DDDC", "#C59D9B"
slip_stitch
= "#424740", "#82A5CE", "#A7937C", "#C2AB9D", "#D4D0E6", "#828586", "#C0BCD0", "#AA9E9F"
ghost
= "#45403F", "#AE978F", "#A65A50", "#C64C3C", "#C8ADA1", "#C89C7A", "#D2C1B1", "#D4CFC9"
This package was re-purposed from the excellent tayloRswift package. 95% of the code is a direct copy pasta and Alexander Stephenson should get credit and citation for this work. Aside from a few tweaks and new color palettes, the code is his. Errors in fromthebottom
are mine.
I also leaned heavily on the R-Bloggers post Extracting colours from your images with Image Quantization which utilizes the magick
package to programmatically extract the HEX colors included here.
The author has no affiliation with the band Phish.
For those who work in Python, it was brought to my attention that there is a very cool package by Josh Borrow called swiftacsmaps.
Other inspirations for this package are the tutorial on creating corporate color palettes by Dr. Simon Jackson, which I drew on heavily. I have long used the wesanderson package by Karthik Ram, which does a similar task.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.