1

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

user31168
  • 145
  • 1
  • 5
  • 2
    It would be very helpful if you provided a reproducible example, and showed us what you have tried. – nograpes Sep 12 '13 at 08:26
  • I don't really see why this is off-topic, to be honest. There are at least a dozen questions like this tagged 'igraph'. – Gabor Csardi Sep 13 '13 at 10:32

0 Answers0