R:wes_palettes:当设置为连续且超过预定义颜色时,如何从 wesanderson 调色板获取颜色十六进制代码

问题描述 投票:0回答:1

各位,

当将 wesanderson 调色板设置为连续颜色多于预定义颜色数量时,我尝试从 wesanderson 调色板获取颜色十六进制代码。

library(wesanderson)

获取预定义调色板的所有十六进制代码:

wes_palettes

但是,如何获取以下图的十六进制代码:

wes_palette(21, name = "Zissou1", type = "continuous")
r colors graphics continuous color-palette
1个回答
0
投票

尝试

unclass

> library('wesanderson')
> pal <- wes_palette(21, name = "Zissou1", type = "continuous")
> unclass(pal)
 [1] "#3A9AB2" "#54A5B9" "#6FB2C1" "#80B6BB" "#91BAB6" "#9BBDAC" "#A5C2A3" "#B1C492" "#BDC881"
[10] "#CCC967" "#DCCB4E" "#DFC12F" "#E3B710" "#E4A70A" "#E79805" "#E98905" "#EC7A05" "#ED6803"
[19] "#EF5703" "#F03801" "#F11B00"
attr(,"name")
[1] "Zissou1"
© www.soinside.com 2019 - 2024. All rights reserved.