1.如何对R语言中两种颜色之间进行细分
2.代码:
x <- colorRampPalette(c("#FC8D62","#FDEAE6"))(12)
#打印向量值
# 按字典顺序排序颜色值
x_sorted <- sort(x,decreasing = TRUE)
# 打印排序后的颜色值
print(x_sorted)
#展示颜色
scales::show_col(x_sorted)
3.输出:
向量值:
"#FDEAE6" "#FCE1DA" "#FCD9CE" "#FCD0C2" "#FCC8B5" "#FCBFAA" "#FCB79E" "#FCAE92" "#FCA686" "#FC9D7A" "#FC956E" "#FC8D62"
图片: