Change the circumferential radial grid segment lines color in the radial.plot function. Plotrix
我有两个数据集,其中包含一个径向图的
第一个数据集:
1 2 3 4 | #data 1 values <- c(0.179615044, 0.011908401, -0.342792441, -0.154263864, -0.251553369, -0.234413350, 0.150411419) colors <- c("black","black","red","red","red","black","black") |
第二个数据集:
1 2 3 4 5 6 | #data 2 values <- c(0.88582075, 0.80089077, 0.79452764, 0.77835694, -0.06816896, 0.24024556, -0.02023557, 0.28804668, -0.88184648, 0.93711689) colors <- c("red", "red", "red", "red","black","black","black","black","red", "red") |
使用以下函数制作径向图时,会得到带有彩色圆形网格线或非彩色圆形网格线的图。 这两个图都具有正确的红色红色径向网格线。
1 2 3 4 | library(plotrix) #plotrix radial plot radial.plot(values, grid.col=colors, rp.type="p") |
如何获得放射状的网格线而不是着色的圆形网格线?
来自数据集1的正确图像(黑色圆形网格+突出显示的径向网格线):
http://i.imgur.com/5e9mJys.png
来自数据集2的图像不正确(红色圆形网格+高亮显示的径向网格线):
http://i.imgur.com/NRFPetY.png
我在
对于代码:https://github.com/kroeliebuschie/radial.plot/blob/master/radial.plot.R
新的参数(
1 2 | #seg.col specifies the line colors radial.plot(values, seg.col=colors, rp.type="p") |
编辑
现在可以更改圆周线。 Jim Lemon添加了此功能并将其称为
参见链接:http://www.inside-r.org/packages/cran/plotrix/docs/radial.plot
尝试使用
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #data 1 values1 <- c(0.179615044, 0.011908401, -0.342792441, -0.154263864, -0.251553369, -0.234413350, 0.150411419) colors1 <- c("black","black","red","red","red","black","black") #data 2 values2 <- c(0.88582075, 0.80089077, 0.79452764, 0.77835694, -0.06816896, 0.24024556, -0.02023557, 0.28804668, -0.88184648, 0.93711689) colors2 <- c("red", "red", "red", "red","black", "black","black","black","red", "red") library(plotrix) #plotrix radial plot radial.plot(values2, line.col = colors2, grid.col ="black", rp.type ="p") |
这将生成以下图像: