install.packages("RColorBrewer") library(RColorBrewer) RColorBrewer包提供了多个设置好的配色方案,使用brewer.pal()函数调用。 brewer.pal(n,names) n为需要颜色的个数,names为配色方案的名称。 data <- replicate(8,rnorm(10, 10, sd = 1.2)) #调用Set3配色的前8个颜色 boxplot(data, col= brewer.p...
1.2 十六进制颜色代码 hexadecimal color code a) 16进制的颜色代码是将RGB颜色值的进制转换的表示方式...
plot(dose, drugB, type="b", pch=23, lty=6, col="blue", bg="green") # 还原了初始的图形参数设置 par(opar) 通过par()设定的参数对两幅图都有效,而在plot()函数中指定的参数仅对那个特定图形有效。 添加文本、自定义坐标轴和图例 除了图形参数,许多高级绘图函数...
barplot(rep(1,length(colors())),col=rev(colors()), names.arg=rev(colors()),horiz=T,las=1, xaxt="n",main=expression("Bars of colors in"~ italic(colors())) dev.off() 1. 2. 3. 4. 5. 6. 7. 2. RGB取色 3. 主题调色板 1) rainbow() raninbow()即彩虹的颜色,是由“赤、橙...
portfolio包提供的tree map(板块层级图):map.market(id, area, group, color)用矩形面积来表示数值,可用于分析磁盘空间占用 lattice包提供的平行坐标图:parallel(data) 绘图示例 > x = rnorm(10) > y = rnorm(10) > plot(x,y) 绘图参数 很多时候,你可能需要调整图形的显示方式。R的绘图参数几乎可以定制图...
plot()函数是R中最基本的绘图函数,其实最简单、最基础的函数,这也就意味着其具有更多的可操作性。 plot(x,y,...) 在plot函数中,只需指定最基本的x和y轴对应数据即可进行图像的绘制,x和y轴数据分别为两个向量或者是只有两列的数据框(第一类为x轴,第二列为y轴)。
portfolio包提供的tree map(板块层级图):map.market(id, area, group, color)用矩形面积来表示数值,可用于分析磁盘空间占用 lattice包提供的平行坐标图:parallel(data) 绘图示例 > x = rnorm(10) > y = rnorm(10) > plot(x,y) 绘图参数 很多时候,你可能需要调整图形的显示方式。R的绘图参数几乎可以定制图...
col.lab color for x and y labels col.main color for titles col.sub color for subtitles fg plot foreground color (axes, boxes - also sets col= to same) bg plot background color You can specify colors in R by index, name, hexadecimal, or RGB.For example col=1, col="white", and ...
2. Particular color names of interest can be found if their positions in the vector are known, e.g., > colors()[c(552,254,26)] [1] "red" "green" "blue" 3.grepcan be used to find color names of interest, e.g., > grep("red",colors()) ...
plot(rep(1,50),col=rainbow(50), pch=19,cex=2) 1. 1.2 R ggplot 默认颜色反转 ggplot默认配色及颜色翻转(reversed colors),scale_color_hue和scales包中的hue_pal()(n): library(gridExtra) ## 排版图片 library(ggplot2) ## ggplot绘图