R语言配色03-wesanderson配色包

library(wesanderson)

可供选择的色板名称包括:

BottleRocket1, BottleRocket2, Rushmore1, Royal1, Royal2, Zissou1, Darjeeling1, Darjeeling2, Chevalier1 , FantasticFox1 , Moonrise1, Moonrise2, Moonrise3, Cavalcanti1, GrandBudapest1, GrandBudapest2, IsleofDogs1, IsleofDogs2

调用颜色的方法

wes_palette函数

wes_palette("Cavalcanti1", 3)

wes_palette("Royal1")

### 调用颜色配图 > 调用方法类似于RcolorBrewer

# simple barplot
barplot(c(2,5,7), col=wes_palette(n=3, name="GrandBudapest2"))

library(ggplot2)
ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) + 
  geom_point(size = 2) + 
  scale_color_manual(values = wes_palette(n=3, name="GrandBudapest2"))