|
From: | harun pirim |
Subject: | [igraph] Re: plotting_clusters_on_a_graph |
Date: | Sun, 29 Aug 2010 12:53:31 -0500 |
# plot a random graph, different color for each component
g <- erdos.renyi.game(100, 1/100)
comps <- clusters(g)$membership
colbar <- rainbow(max(comps)+1)
V(g)$color <- colbar[comps+1]
plot(g, layout=layout.fruchterman.reingold, vertex.size=5, vertex.label=NA)
Hi All,
I need to figure out a way of plotting clusters on a graph. I use R.
In the plot I will have the network on the background and circles over the vertices that make up the clusters.
Is there an easy way to to this? Even it is ok to color the vertices of the same cluster having different colors for each cluster.
I have the graph g, and the membership vector m.
Thank you,
Harun Pirim
[Prev in Thread] | Current Thread | [Next in Thread] |