igraph-help
[Top][All Lists]
Advanced

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

[igraph] plot color with dendrogram


From: Laurette Chardon
Subject: [igraph] plot color with dendrogram
Date: Fri, 26 Jul 2019 11:27:45 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

Hi,

I'm using igraph recently with python on a debian system.

I succeded in creating a dendrogram and plot it :

comms = G.community_walktrap()

igraph.plot(comms,  mot+"-walktrap.svg")

But i don't see how to colorize it.

I tried :

comms2=comms.as_clustering(n=5)

igraph.plot(comms2,  mot+"-walktrap.svg",mark_groups = True)

It works but it's not a dendrogram because comms and comms2 are differents objects :

type(comms) -> <class 'igraph.clustering.VertexDendrogram'>

type(comms2) ->  <class 'igraph.clustering.VertexClustering'>


So i tried :

G1,G2,G3,G4,G5=comms2.subgraphs()
dict={}
dict['red']=G1.get_edgelist()
dict['green']=G2.get_edgelist()
dict['blue']=G3.get_edgelist()
dict['yellow']=G4.get_edgelist()
dict['magenta']=G5.get_edgelist()

and :

igraph.plot(comms,  mot+"-walktrap.svg",mark_groups = dict)

but the plot still is black and white ...

Any idea ?

Thanks for your help

best,

L Chardon

--
logo_crisco Laurette CHARDON
Ingénieure de Recherche informatique
Service : +33(0)2 31 56 57 37
Bâtiment N3 - Sous-sol - porte SA S13 - Esplanade de la Paix
CS 14032- 14032 CAEN Cedex 5
www.crisco.unicaen.fr
Faites un geste pour l'environnement, n'imprimez ce mail que si nécessaire



Avast logo

L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
www.avast.com



reply via email to

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