I want to create a graph plot with each community of nodes been covered by some background color, similar to the graph by the following code
karate <- graph.famous("Zachary")
wc <- walktrap.community(karate)
modularity(wc)
membership(wc)
plot(wc, karate)
But different from this approach, I want to: (1) group the nodes by myself, instead of resulting from community detection algorithm. I achieved this by wc$membership <- some_vector
; (2) plot such graph possibly with overlap between communities, then how can I assign one node to multiple communities?
Plot the graph itself instead of the community structure, and use an appropriately constructed
mark.groups
argument toplot()
to tell igraph which groups should be enclosed by the same group. The following quote is from the manual page ofplot.igraph
: