我试图用以下数据制造极地块。
gr1 <- c(0, 5, 15, 20, 30, 40)
gr3 <- c(0, 5, 10, 25, 40, 60, 80)
gr2 <- c(0, 15, 25, 30, 40)
df2<- data.frame (pos = c(gr1, gr2, gr3), group = c(rep(1, length(gr1)),
rep(2, length(gr1)), rep(2, length(gr1))))
inner circle segment to mark
first tier, group 1, between 15, 20
group 3, between 5, 10
between 40 to 60
second tier, group 1, between 15, 20
group 3, between 5, 10
between 10, 25
between 40 to 60
两岸间两行之间的争.。
我的实际数据分两层以上。
标记可以是部分标记,也可以是其他标记,如填充的颜色。
不同的群体如有可能,可以有色码。
替代部分标识(首页)
我用批号2对其进行审判。
cx <- ggplot(df2, aes(x = pos, group = group) + geom_bar(width = 1, colour = "black"))
Error in aes(x = pos, group = group) + geom_bar(width = 1, colour = "black") :
non-numeric argument to binary operator
cx + coord_polar()
更多审判:
df2$cpos <- cumsum (df2$pos)
cx <- ggplot(df2, aes(x = cpos, group = group) + geom_bar(width = 1, colour = "black"))
∗
I think I might be terrible to explain the issue. Here is figure with explanation.
假设(位置)是连续的,极地的角视位置的价值而定。 一旦一个小组完成,它将重新启动。 我 did了这个骗子(我可能错了)。
Edits:
下面的回答为这一问题提供了更多的考虑。 这是经过改进的版本,但彩色管理没有发挥作用。
df2$cpos <- cumsum (df2$pos)
df2$y <- rep(3, length (df2$cpos))
cx <- ggplot(df2, aes(y = y, x = cpos))
cx + geom_bar(aes(stat = "identity",fill="yellow", colour = "yellow" )) +
geom_point(aes(color = factor(group)), pch = 18, size = 2) + coord_polar() +
scale_fill_manual(values=c("#CC6666", "#9999CC", "#66CC99"))+ ylim(0,3)
当我试图 set平时(2,3),这样他们就象一些不工作的群体一样。
Error in data$y[data$y == -Inf] <- range$y.range[1] :
replacement has length zero