我上周确实发布了这个,但我没有正确解释它,我希望你们中的一些人能帮助我......
我正在尝试将多层同心环绘制为图形的顶点。
在这里你可以找到我所做的简单版本,以及我想要做什么。请注意,边缘也应与顶点一起拖动。
这是前者的代码:
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)
谢谢,纳特