Skip to content

alexskeels/waRhol

Repository files navigation

waRhol

waRhol is an R package containing colour palettes inspired by the paintings of Andy Warhol. It can be directly integrated with ggplot and base R plotting.

Installation

You can install the development version of waRhol from GitHub with:

# install.packages("devtools")
devtools::install_github("alexskeels/waRhol")

Palettes

Here are the palettes:

library(waRhol)
library(ggplot2)

pal_names <- names(warhol_palettes)

par(mfrow=c(length(warhol_palettes)/2, 2), lheight = 2, mar=rep(1, 4), adj = 0)
for (i in 1:length(warhol_palettes)){
  viz_palette(warhol_palettes[[i]], pal_names[i])
}

inspiration

skull_76_1

viz_palette(warhol_palettes[["skull_76_1"]])

skull_76_2

viz_palette(warhol_palettes[["skull_76_2"]])

skull_77

viz_palette(warhol_palettes[["skull_77"]])

skull_86

viz_palette(warhol_palettes[["skull_86"]])

marilyn_orange_62

viz_palette(warhol_palettes[["marilyn_orange_62"]])

marilyn_green_62

viz_palette(warhol_palettes[["marilyn_green_62"]])

marilyn_67

viz_palette(warhol_palettes[["marilyn_67"]])

camo_87

viz_palette(warhol_palettes[["camo_87_1"]])

viz_palette(warhol_palettes[["camo_87_2"]])

viz_palette(warhol_palettes[["camo_87_3"]])

viz_palette(warhol_palettes[["camo_87_4"]])

viz_palette(warhol_palettes[["camo_87_5"]])

bighorn_ram_83

viz_palette(warhol_palettes[["bighorn_ram_83"]])

basquiat_85

viz_palette(warhol_palettes[["basquiat_85"]])

the_big_c_86

viz_palette(warhol_palettes[["the_big_c_86"]])

Useage examples

Example of a discrete palette in ggplot

ggplot(diamonds) + 
  geom_bar(aes(x = cut, fill = clarity)) +
  theme_light()+
  scale_fill_warhol(palette="bighorn_ram_83")

Example of a continuous palette in ggplot

ggplot(mtcars, aes(mpg, wt)) + 
  geom_point(aes(colour = hp), size=2) +     
  scale_colour_warhol(palette="camo_87_1", discrete = FALSE)+
  theme_light()

ggplot(mtcars, aes(mpg, wt)) + 
  geom_point(aes(colour = hp), size=2) +     
  scale_colour_warhol(palette="marilyn_orange_62", discrete = FALSE)+
  theme_light()

Example of a continuous palette in base R

par(mfrow=c(1,1))
pal <- colorRampPalette(warhol_palettes[["skull_76_2"]])
image(volcano, col = pal(20))

About

An Andy Warhol colour palette for R

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages