Concentric rings in pie chart as nodes of a network using R

366 views Asked by At

I am trying to draw multilayer concentric rings as nodes of a graph.

Here you can find a simple version of what I did, and here what what I want to do. Note that the edge should also be dragged with the node.

This is the code for the former:

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)

Thanks, Nat

0

There are 0 answers