colors()函数列出当前已经支持的颜色名称
[19] "bisque3" "bisque4" "black"
[22] "blanchedalmond" "blue" "blue2"
[25] "blue3" "blue4" "blueviolet"
[28] "brown" "brown1" "brown2"
[31] "brown3" "brown4" "burlywood"
[34] "burlywood1" "burlywood2" "burlywood3"
[37] "burlywood4" "cadetblue" "cadetblue1"
[40] "cadetblue2" "cadetblue3" "cadetblue4"
[43] "chartreuse" "chartreuse2" "chartreuse3"
[46] "chartreuse4" "chocolate" "chocolate1"
[49] "chocolate2" "chocolate3" "chocolate4"
[52] "coral" "coral1" "coral2"
[55] "coral3" "coral4" "cornflowerblue"
[58] "cornsilk" "cornsilk2" "cornsilk3"
[61] "cornsilk4" "cyan" "cyan2"
[64] "cyan3" "cyan4" "darkgoldenrod"
[67] "darkgoldenrod1" "darkgoldenrod2" "darkgoldenrod3"
[70] "darkgoldenrod4" "darkgray" "darkgreen"
[73] "darkkhaki" "darkmagenta" "darkolivegreen"
[76] "darkolivegreen1" "darkolivegreen2" "darkolivegreen3"
[79] "darkolivegreen4" "darkorange" "darkorange1"
[82] "darkorange2" "darkorange3" "darkorange4"
[85] "darkorchid" "darkorchid1" "darkorchid2"
[88] "darkorchid3" "darkorchid4" "darkred"
[91] "darksalmon" "darkseagreen" "darkseagreen1"
[94] "darkseagreen2" "darkseagreen3" "darkseagreen4"
[97] "darkslateblue" "darkslategray" "darkslategray1"
[100] "darkslategray2" "darkslategray3" "darkslategray4"
[103] "darkturquoise" "darkviolet" "deeppink"
[106] "deeppink2" "deeppink3" "deeppink4"
[109] "deepskyblue" "deepskyblue2" "deepskyblue3"
palette()函数查看当前调色板
也可以通过palette(c("red","blue","green"))修改当前调色方案为3种颜色
指定颜色的多种方案
① 通过col="red",col="blue"等直接用已经支持的颜色名称进行指定
②通过col=数字,指定与当前调色板有关的颜色,如col=1,表示调色板第一个颜色,col=0表示与背景色相同
③通过8位十六进制进行颜色表示
# col="#11223344"
颜色都是由三基色”红、绿、蓝“合成
前两位表示红色的颜色值,紧接着2位为绿色颜色值,蓝色颜色值,最后两位为透明度值
rgb()函数将颜色值转变为十六进制数
函数heat.colors(10)给出10个从暗到亮的颜色的十六进制表示
函数rainbow与heat.colors函数有异曲同工之妙,同样是给出几种彩虹色比较绚丽多彩