igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] drawing bipartite weighted graphs [Python]


From: Pagliari, Roberto
Subject: Re: [igraph] drawing bipartite weighted graphs [Python]
Date: Sat, 19 Jul 2014 02:37:11 +0000

Yes you are right... but I was wondering if there is a built-in function to 
plot a bipartite graph in the usual fashion they are shown, namely, with edges 
over two columns, connected by edges....

Thank you

-----Original Message-----
From: Tamás Nepusz [mailto:address@hidden 
Sent: Friday, July 18, 2014 6:08 PM
To: Help for igraph users; Pagliari, Roberto
Subject: Re: [igraph] drawing bipartite weighted graphs [Python]

> I haven't found much about this. Could someone, possibly provide a 
> minimalistic example about drawing a bipartite graph in python?
Errrrm.... how are bipartite graphs different from ordinary graphs when it 
comes to plotting? :) AFAIK you could simply use plot(g) to plot a graph no 
matter whether it's bipartite or not. If you want to color the nodes 
differently depending on which part of the graph they belong to, you could do 
something like:

plot(g, vertex_color=["red" if type == True else "blue" for type in 
g.vs["type"]])

(Assuming that the "type" vertex attribute contains which part of the graph the 
vertices belong to).

T.

reply via email to

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