Coder Social home page Coder Social logo

wesanderson's Introduction

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] "BottleRocket1"  "BottleRocket2"  "Rushmore1"      "Rushmore"      
#>  [5] "Royal1"         "Royal2"         "Zissou1"        "Darjeeling1"   
#>  [9] "Darjeeling2"    "Chevalier1"     "FantasticFox1"  "Moonrise1"     
#> [13] "Moonrise2"      "Moonrise3"      "Cavalcanti1"    "GrandBudapest1"
#> [17] "GrandBudapest2" "IsleofDogs1"    "IsleofDogs2"    "FrenchDispatch"
#> [21] "AsteroidCity1"  "AsteroidCity2"  "AsteroidCity3"

Palettes

Bottle Rocket (1996)

wes_palette("BottleRocket1")

wes_palette("BottleRocket2")

Rushmore (1998)

wes_palette("Rushmore1")

The Royal Tenenbaums (2001)

wes_palette("Royal1")

wes_palette("Royal2")

library("ggplot2")
ggplot(mtcars, aes(factor(cyl), fill=factor(vs))) +  geom_bar() +
  scale_fill_manual(values = wes_palette("Royal1"))

The Life Aquatic with Steve Zissou (2004)

wes_palette("Zissou1")

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

pal <- wes_palette("Zissou1", 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() 

The Darjeeling Limited (2007)

wes_palette("Darjeeling1")

wes_palette("Darjeeling2")

Hotel Chevalier (2007)

wes_palette("Chevalier1")

Fantastic Mr. Fox (2009)

wes_palette("FantasticFox1")

Moonrise Kingdom (2012)

wes_palette("Moonrise1")

wes_palette("Moonrise2")

wes_palette("Moonrise3")

Castello Cavalcanti (2013)

wes_palette("Cavalcanti1")

The Grand Budapest Hotel (2014)

wes_palette("GrandBudapest1")

wes_palette("GrandBudapest2")

The Isle of Dogs (2018)

wes_palette("IsleofDogs1")

wes_palette("IsleofDogs2")

The French Distpatch (2021)

wes_palette("FrenchDispatch")

Asteroid City (2023)

wes_palette("AsteroidCity1")

wes_palette("AsteroidCity2")

wes_palette("AsteroidCity3")

As seen in these publications

Imgur

Imgur

Imgur

Imgur

Imgur

Imgur

wesanderson's People

Contributors

aaronbaggett avatar ck37 avatar hadley avatar karthik avatar kristang avatar mhart avatar michaelmhoffman avatar mpadge avatar nowosad avatar ptdewey avatar richardsc avatar roblisy avatar thomaskatkins avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wesanderson's Issues

Feature Request: Input using NSE

Now the input is like wes_palette("BottleRocket1"), how about
wes_palette(BottleRocket1) using NSE like dplyr.

Because it helps use tab button to type the full name.

Possible to send an update to CRAN?

In the CRAN version manual we see that the palette choices are:

List of 15
$ GrandBudapest : chr [1:4] "#F1BB7B" "#FD6467" "#5B1A18" "#D67236"
$ Moonrise1 : chr [1:4] "#F3DF6C" "#CEAB07" "#D5D5D3" "#24281A"
$ Royal1 : chr [1:4] "#899DA4" "#C93312" "#FAEFD1" "#DC863B"
$ Moonrise2 : chr [1:4] "#798E87" "#C27D38" "#CCC591" "#29211F"
$ Cavalcanti : chr [1:5] "#D8B70A" "#02401B" "#A2A475" "#81A88D" ...
4 wes_palettes
$ Royal2 : chr [1:5] "#9A8822" "#F5CDB4" "#F8AFA8" "#FDDDA0" ...
$ GrandBudapest2: chr [1:4] "#E6A0C4" "#C6CDF7" "#D8A499" "#7294D4"
$ Moonrise3 : chr [1:5] "#85D4E3" "#F4B5BD" "#9C964A" "#CDC08C" ...
$ Chevalier : chr [1:4] "#446455" "#FDD262" "#D3DDDC" "#C7B19C"
$ Zissou : chr [1:5] "#3B9AB2" "#78B7C5" "#EBCC2A" "#E1AF00" ...
$ FantasticFox : chr [1:5] "#DD8D29" "#E2D200" "#46ACC8" "#E58601" ...
$ Darjeeling : chr [1:5] "#FF0000" "#00A08A" "#F2AD00" "#F98400" ...
$ Rushmore : chr [1:5] "#E1BD6D" "#EABE94" "#0B775E" "#35274A" ...
$ BottleRocket : chr [1:7] "#A42820" "#5F5647" "#9B110E" "#3F5151" ...
$ Darjeeling2 : chr [1:5] "#ECCBAE" "#046C9A" "#D69C4E" "#ABDDDE" ...

But here on GitHub we see slight differences in the names of the palettes:

# See all palettes
names(wes_palettes)
#>  [1] "BottleRocket1"  "BottleRocket2"  "Rushmore1"      "Royal1"        
#>  [5] "Royal2"         "Zissou1"        "Darjeeling1"    "Darjeeling2"   
#>  [9] "Chevalier1"     "FantasticFox1"  "Moonrise1"      "Moonrise2"     
#> [13] "Moonrise3"      "Cavalcanti1"    "GrandBudapest1" "GrandBudapest2"

The Rushmore vs Rushmore1 is causing some problems for me.

Can you push an update to CRAN so we have Rushmore1 on CRAN and on GitHub?

thanks!

Upcoming updates

Based on discussions with Hadley, I'm going to rework the package to stop mimicking the same style as RColorBrewer.

  • I'll just add S3 methods to just plot any palette
  • Avoid using get
  • Add a whole slew of new palettes I've been painstakingly assembling (no longer from the tumblr)

If anyone has other suggestions, please add here. I'll leave this version as-is for RColorBrewer fans and bump up to version 2.

Error in wes_palette(n = 3, "GrandBudapest") : Palette not found.

ggplot(df, mapping = aes(published.on.the.dn, fill = published.on.the.dn) ) +
 geom_bar(stat = 'count') +
  labs(x = "Published on the DN?", 
       y = "Count", 
       title = TitleXYZ",
       fill = "Legend") +
  theme(plot.title = element_text(hjust = 0.5)) +
  scale_fill_manual((values=wes_palette(n = 3, "GrandBudapest")))

Error in wes_palette(n = 3, "GrandBudapest") : Palette not found.

R.version

OUTPUT:
platform       x86_64-apple-darwin15.6.0   
arch           x86_64                      
os             darwin15.6.0                
system         x86_64, darwin15.6.0        
status                                     
major          3                           
minor          5.1                         
year           2018                        
month          07                          
day            02                          
svn rev        74947                       
language       R                           
version.string R version 3.5.1 (2018-07-02)
nickname       Feather Spray  

Installation from Github fails

Hi

Cool package!

There's a "hadley" reference in the link when you try to install the dev version.

> devtools::install_github("karthik/wesanderson")
Installing github repo(s) karthik/wesanderson/master from hadley
Downloading karthik/wesanderson.zip from https://github.com/hadley/karthik/wesanderson/archive/master.zip
Error: client error: (404) Not Found

/Kenneth

Bug report

It is not possible to use the package without loading it:

wesanderson::wes.palette(4, "Royal1")
# Error in match(x, table, nomatch = 0L) : object 'namelist' not found

I had a quick poke, but it's not related to the LazyData field. I'm sure the answer is in
writing R extensions, but I can't find it.

five zissou colors ... too few

Error: Insufficient values in manual scale. 6 needed but only 5 provided.

Are you finding what you were looking for... out here with me? I hope so.

Correct citation

Hey, I used your package for my thesis and I would like to correctly cite your work. Can you give the needed information? Thanks again for you work!

wes.palette does not work when package not attached

It is not possible to use the package without loading it:

wesanderson::wes.palette(4, "Royal1")
# Error in match(x, table, nomatch = 0L) : object 'namelist' not found

I had a quick poke, but it's not related to the LazyData field. I'm sure the answer is in
writing R extensions, but I can't find it.

How to remove segment lines in stack bar chart

Hey,

I really like your package!

I started using it and for some reason when I draw stacked bar plots each segment gets lines around them. This problem only appeared after using the "wesanderson"-package.

ggplot(filterpie, aes(x=Sample, fill=species, y=Abundance))+ geom_col(aes(color=species, fill=species), position="fill")+ scale_fill_manual(values =wes_palette("BottleRocket1", 21, type = "continuous"))

Is there a way to remove this?

image

Out of date

The colors are out of date. I was wondering if anybody can take over this package and update this with new Wes Anderson color schemes.

Asteroid City Color Palettes

Hi, first I just want to say I'm a big fan of both this package and Wes Anderson's movies.

I was hoping the new movie Asteroid City would bring new color palettes, but it seems the tumblr blog has not been updated for some time now, so I took the liberty of creating a few palettes of my own in a fork of this repo.
In case there is interest in adding these to the package, I will open a pr.

Keep up the good work!

Thank you!!!

This is gold!!! I adore Wes Anderson films, R and design -- and what a great idea to put them all together! Yaaaaay! Thank you! Thank you! Thank you!!!!!

Choosing subsets from palette

I am wondering if there is a way to choose a specific subset from a palette. For example, if I am using GrandBudapest2 and would like to use the first and second color in scale_fill_manual and then use the third and fourth from the same palette in scale_color_manual. Is this possible?

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.