1

I have two datasets which contain values for a radial plot and colors for the radial grid lines of this plot.

First dataset:

#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")

Second dataset:

#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")

When I make the radial plots with the following function, I get plots with either colored circular grid lines or non colored circular grid lines. Both plots have the correct radial grid lines colored red.

library(plotrix)

#plotrix radial plot
radial.plot(values, grid.col=colors, rp.type="p")

How do I get the radial grid lines the get colored and not the circular grid lines? Is grid.col the wrong argument the use here?

correct image from dataset 1 (black circular grid + highlighted radial grid lines):

http://i.imgur.com/5e9mJys.png

incorrect image from dataset 2 (red circular grid + highlighted radial grid lines):

http://i.imgur.com/NRFPetY.png

4

2 回答 2

1

我在radial.plot代码中发现了一个错误。新代码修复了这个问题,并且只为径向线段着色。

对于代码:https ://github.com/kroeliebuschie/radial.plot/blob/master/radial.plot.R

新参数 ( seg.col) 指定径向线段。

#seg.col specifies the line colors
radial.plot(values, seg.col=colors, rp.type="p")

编辑

现在可以更改圆周线。Jim Lemon 已添加此功能并已将其称为grid.col

见链接: http: //www.inside-r.org/packages/cran/plotrix/docs/radial.plot

于 2013-08-27T10:25:42.327 回答
-1

试试这样的line.col论点:

#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")

这会生成下面的图像:

截屏

于 2013-08-14T11:08:49.920 回答