Installation
代码语言:javascript复制install.packages("wesanderson")
Or the development version
代码语言:javascript复制devtools::install_github("karthik/wesanderson")
Usage
代码语言:javascript复制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"
颜色版
Bottle Rocket (1996)
代码语言:javascript复制wes_palette("BottleRocket1")
代码语言:javascript复制wes_palette("BottleRocket2")
Rushmore (1998)
代码语言:javascript复制wes_palette("Rushmore1")
The Royal Tenenbaums (2001)
代码语言:javascript复制wes_palette("Royal1")
image.png
代码语言:javascript复制wes_palette("Royal2")
代码语言:javascript复制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)
代码语言:javascript复制wes_palette("Zissou1")
代码语言:javascript复制pal <- wes_palette("Zissou1", 21, type = "continuous")
image(volcano, col = pal)
代码语言:javascript复制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)
代码语言:javascript复制wes_palette("Darjeeling1")
代码语言:javascript复制wes_palette("Darjeeling2")
Hotel Chevalier (2007)
代码语言:javascript复制wes_palette("Chevalier1")
Fantastic Mr. Fox (2009)
代码语言:javascript复制wes_palette("FantasticFox1")
Moonrise Kingdom (2012)
代码语言:javascript复制wes_palette("Moonrise1")
代码语言:javascript复制wes_palette("Moonrise2")
代码语言:javascript复制wes_palette("Moonrise3")
Castello Cavalcanti (2013)
代码语言:javascript复制wes_palette("Cavalcanti1")
The Grand Budapest Hotel (2014)
代码语言:javascript复制wes_palette("GrandBudapest1")
代码语言:javascript复制wes_palette("GrandBudapest2")
The Isle of Dogs (2018)
代码语言:javascript复制wes_palette("IsleofDogs1")
代码语言:javascript复制wes_palette("IsleofDogs2")