Skip to content Skip to sidebar Skip to footer

Plot A Tree-like Graph With Root Node At The Top

I have the following toy graph that represents, for instance, a forum thread: import igraph as ig g = ig.Graph(n = 12, directed=True) g.add_edges([(1,0),(2,1), (3,2), (4,3),

Solution 1:

OK, I'll just add this as an answer, for the comments.

So the Reingold-Tilford layout works: http://igraph.sourceforge.net/doc/python/igraph.Graph-class.html#layout_reingold_tilford

layout = g.layout_reingold_tilford(mode="in", root=0)

Post a Comment for "Plot A Tree-like Graph With Root Node At The Top"