❝本节来介绍一款连续型调色板包「scico」有30多个配色可供选择,同时还支持将配色导出为十六进制代码非常的方便,从此再也不用担心热图配色过于单一了。更多详细内容请参考作者官方文档 ❞
❝https://github.com/thomasp85/scico ❞
devtools::install_github("thomasp85/scico")
library(scico)
library(tidyverse)
scico提供 35 种不同的调色板,可以使用scico_palette_show()函数查看
scico_palette_show()
scico(10, palette = 'lapaz')
volcano <- data.frame(
x = rep(seq_len(ncol(volcano)), each = nrow(volcano)),
y = rep(seq_len(nrow(volcano)), ncol(volcano)),
height = as.vector(volcano)
)
ggplot(volcano, aes(x = x, y = y, fill = height)) +
geom_raster() +
scale_fill_scico(palette = 'vik') +
theme_bw()