igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] assigning attributes to vertices


From: patrick wintrode
Subject: [igraph] assigning attributes to vertices
Date: Sun, 16 Nov 2008 12:22:12 -0800 (PST)

Hi.

To get a feel for igraph, I'm trying to reproduce the example in "screenshots" 
where an Erdos-Renyi graph is colored by cluster size. I'm using R instead of 
python (I'm also fairly new to R).

After making the ER graph (named g), I did the following:

cl <- clusters(g)$membership
plot(g, layout=layout.fruchterman.reingold, vertex.size=6, vertex.label=NA, 
vertex.color=cl)

Obviously, this colors by cluster # and not by size. When I try:

cm <- clusters(g)$csize
plot(g, layout=layout.fruchterman.reingold, vertex.size=6, vertex.label=NA, 
vertex.color=cm)

The coloring is completely wrong.
I'm wondering how to assign cluster size as an attribute to the vertices.

Thanks.

Patrick





reply via email to

[Prev in Thread] Current Thread [Next in Thread]