On Thu, Apr 5, 2012 at 4:41 AM, Narges Zarrabi <[email protected]> wrote:
> Hi,
>
> I am also using the following code, taken from igraph examples
> (http://igraph.sourceforge.net/screenshots2.html#8) , to detect communities
> in networks.
> Could you please let me know what the nodes color and the red color of the
> edges represent in this example? Thanks in advance!

I answered this in your other email, but just for te records and the
mailing list archive:

Node colors represent community membership. Red edges go between communities.

Gabor

> library(igraph)
> g <- read.graph("karate.net", format="pajek")
>
> cs <- leading.eigenvector.community.step(g)
> V(g)$color <- ifelse(cs$membership==0, "lightblue", "green")
>
> scale <- function(v, a, b) {
>   v <- v-min(v) ; v <- v/max(v) ; v <- v * (b-a) ; v+a
> }
>
> V(g)$size <- scale(abs(cs$eigenvector), 10, 20)
> E(g)$color <- "grey"
> E(g)[ V(g)[ color=="lightblue" ] %--% V(g)[ color=="green" ] ]$color <-
> "red"
>
> tkplot(g, layout=layout.kamada.kawai, vertex.label.font=2)
>
> Regards,
> Narges
>
> _______________________________________________
> igraph-help mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>



-- 
Gabor Csardi <[email protected]>     MTA KFKI RMKI

_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help

Reply via email to