igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] coloring nodes according to components in a graph


From: Gábor Csárdi
Subject: Re: [igraph] coloring nodes according to components in a graph
Date: Wed, 3 Nov 2010 17:57:18 +0100

Simone,

plot(g, vertex.color=clusters(g)$membership+1)

or if you want a custom color bar, then

colbar <- heat.colors(40)  # say, or you can check the number of components
plot(g, vertex.color=colbar[clusters(g)$membership+1])

Untested, sorry about that.

Best,
Gabor

On Wed, Nov 3, 2010 at 5:28 PM, Simone Gabbriellini
<address@hidden> wrote:
> Hello list,
>
> I've seen the python example for coloring nodes in a graph according to 
> clusters.
> Could you give me a hand in translating the code for R?
>
> thanks,
> Simone
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>



-- 
Gabor Csardi <address@hidden>     UNIL DGM



reply via email to

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