饼图中的同心环作为使用R的网络的节点

时间:2013-09-12 08:05:26

标签: r charts igraph pie-chart drupal-nodes

我试图将多层同心环绘制为图形的节点。

在这里,您可以找到what I did的简单版本,以及what I want to do。 请注意,也应该使用节点拖动边缘。

这是前者的代码:

library(igraph)
g=graph.empty(4)
g[1,2]=T
g[3,4]=T
resColors=matrix(as.character(list("green","red","green","green","green","grey","grey",  "green","green","green","red","red","green","green","green","green","red","red","green","green")), nrow=vcount(g))
colors = list()
values = list()
for (i in 1:vcount(g)) {
   values[[i]] = rep(1, times = ncol(resColors))
   colors[i] = list(resColors[i,])
}
size=c(60,50,30,20)
plot(g, vertex.shape = "pie", vertex.pie = values, vertex.pie.color = colors, vertex.size = size)

谢谢, 纳特

0 个答案:

没有答案