NetworkX and Graphviz layout

434 views
Skip to first unread message

Michele Tizzoni

unread,
Feb 6, 2012, 10:31:57 AM2/6/12
to networkx...@googlegroups.com
Hi everybody,
I am trying to draw a network using NetworkX and the Graphviz layout "twopi".

Everything works fine, but I would like to use some graph attributes like "overlap = false" that are available for the graphs in Graphviz.
However, I don't know how to set such graph attributes in NetworkX, such that the command graphviz_layout will recognize them.

Do you know if this is possible with NetworkX?
Could you help me?
Thanks,

Michele

Aric Hagberg

unread,
Feb 6, 2012, 11:22:53 AM2/6/12
to networkx...@googlegroups.com

Yes, that should work. There isn't much documentation. Try, e.g.

In [1]: import networkx as nx

In [2]: G=nx.cycle_graph(5)

In [3]: pos=nx.graphviz_layout(G,prog='twopi',args='-Goverlap=false')

Aric

Reply all
Reply to author
Forward
0 new messages