How to draw a network with poniform vertices using Igraph?

I would like to portray a network with Ring / Donut Shaped Vertices. I did not find such a form in the Igraf documentation, but instead found a pie. Like the following code:

library(igraph)
g <- make_ring(10) 
values <- lapply(1:10, function(x) sample(1:10,3)) 
if (interactive()) { 
    plot(g, vertex.shape="pie", vertex.pie=values,            
         vertex.pie.color=list(heat.colors(5)), 
         vertex.size=seq(10,30,length=10), vertex.label=NA) 
}

Here's the resulting image:

enter image description here

Do you know a way to turn a pie-shaped top into a ring / donut top using Igraph itself? I searched for the parameter "vertex.pie.hole", but it does not exist. The easiest way to do this is to draw white dots in the centroids of the vertices, but this is clearly not an ideal situation.

I also know that you can define our own vertex shape, but I must admit that it was very difficult for me to do this for the shape of the ring / donut.

Thank you very much for your attention,

+4
1

, , : , . , .

  set.seed(2)
  plot(g, vertex.shape="pie", vertex.pie=values,            
       vertex.pie.color=list(heat.colors(5)), 
       vertex.size=seq(10,30,length=10), vertex.label=NA) 

  set.seed(2)
  plot(g, 
       vertex.size=seq(5,15,length=10), vertex.label=NA, 
       vertex.color="white", 
       edge.color=NA,
       add=TRUE) 

enter image description here

+4

Source: https://habr.com/ru/post/1680679/


All Articles