Skip to content

binkymilk/wesanderson

 
 

Repository files navigation



Wes Anderson Palettes

Build Status
CRAN Downloads

I saved you from boring plots. What did you ever do? - Max Fischer (probably)

Tired of generic mass produced palettes for your plots? Short of adding an owl and dressing up your plot in a bowler hat, here's the most indie thing you can do to one. First round of palettes derived from the amazing Tumblr blog Wes Anderson Palettes.

Installation

install.packages("wesanderson")

Or the development version

devtools::install_github("karthik/wesanderson")

Usage

library(wesanderson)

# See all palettes
names(wes_palettes)
#>  [1] "GrandBudapest"  "Moonrise1"      "Royal1"         "Moonrise2"     
#>  [5] "Cavalcanti"     "Royal2"         "GrandBudapest2" "Moonrise3"     
#>  [9] "Chevalier"      "Zissou"         "FantasticFox"   "Darjeeling"    
#> [13] "Rushmore"       "BottleRocket"   "Darjeeling2"

Grand Budapest

library(ggplot2)
ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) + 
  geom_point(size = 3) + 
  scale_color_manual(values = wes_palette("GrandBudapest")) + 
  theme_gray()

plot of chunk grandbudapest

Moonrise Kingdom

wes_palette("Moonrise1")

plot of chunk moonrise

wes_palette("Moonrise2")

plot of chunk moonrise

wes_palette("Moonrise3")

plot of chunk moonrise

Royal Tenenbaums

wes_palette("Royal1")

plot of chunk royal

wes_palette("Royal2")

plot of chunk royal

qplot(factor(cyl), data=mtcars, geom="bar", fill=factor(vs)) + 
  scale_fill_manual(values = wes_palette("Royal1"))

plot of chunk ggplot1

Castello Cavalcanti

wes_palette("Cavalcanti")

plot of chunk castello

Hotel Chevalier

wes_palette("Chevalier")

plot of chunk chevalier

The Life Aquatic

wes_palette("Zissou")

plot of chunk lifeaquatic

pal <- wes_palette("Zissou", 21, type = "continuous")
image(volcano, col = pal)

plot of chunk volcano

pal <- wes_palette("Zissou", 100, type = "continuous")
# heatmap is a local dataset
ggplot(heatmap, aes(x = X2, y = X1, fill = value)) +
  geom_tile() + 
  scale_fill_gradientn(colours = pal) + 
  scale_x_discrete(expand = c(0, 0)) +
  scale_y_discrete(expand = c(0, 0)) + 
  coord_equal() 

plot of chunk zissou_heatmap

Darjeeling Limited

wes_palette("Darjeeling")

plot of chunk darjeeling

wes_palette("Darjeeling2")

plot of chunk darjeeling

Fantastic Mr. Fox

wes_palette("FantasticFox")

plot of chunk fantasticfox

Rushmore

wes_palette("Rushmore")

plot of chunk rushmore

Bottle Rocket

wes_palette("BottleRocket2")
#> Error in wes_palette("BottleRocket2"): Palette not found.

Gallery of examples

About

A Wes Anderson color palette for R

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • R 100.0%