尝试使用hcl
和调整亮度步骤。例如:
cols <- hcl(0,l=seq(1,100,length=11))
cols
# [1] "#3F0000" "#470016" "#591D2D" "#6F3744" "#87505B" "#A06974" "#BB838D" "#D69DA8"
# [9] "#F1B8C3" "#FFD4DE" "#FFF0FB"
plot(1:11,cex=4,bg=cols,pch=21)
下面有很多例子?hcl
,我相信你会找到一些适合你需要的颜色中断。
如果这不符合您的需求,您还可以使用RColorBrewer
包装下的一些色标,我强烈推荐(查看他们出色的网站以获取更多色标),并使用colorRampPalette
with插入颜色brewer.pal
并可能截断结尾色标。
您还可以使用发散色标,再次从而RColorBrewer
不是顺序色标。所以这里有一些例子:
require(RColorBrewer)
par(mfrow=c(2,2))
cols <- colorRampPalette( colors = hcl(0,l=seq(1,100,length=11)) )
plot( 1:11 , cex = 4 , bg = cols(11) , pch = 21 , main = "HCL Colours")
cols <- colorRampPalette( colors = rev(brewer.pal(9,"Reds")) )
plot( 1:11 , cex = 4 , bg = cols(11) , pch = 21 , main = "Sequential RColorBrewer palette")
cols <- colorRampPalette( colors = rev(brewer.pal(9,"Reds"))[1:5] )
plot( 1:11 , cex = 4 , bg = cols(11) , pch = 21 , main = "Truncated sequential\nRColorBrewer palette" )
cols <- colorRampPalette( colors = brewer.pal(9,"RdBu") )
plot( 1:11 , cex = 4 , bg = cols(11) , pch = 21 , main = "Diverging RColorBrewer palette" )