Pass arguments to graphviz for pydot graph

19 views Asked by At

I've got a pydot graph representing a hierarchy I've generated in networkx and I'm trying to output it to disk with graphviz attributes.

So far I've got:

p = nx.drawing.nx_pydot.to_pydot(G)
p.write_png('test.png')

This is fine, but the graph can get pretty cluttered and super wide with a bunch of nodes at the same level in the hierarchy, so I'd love to play with some graphviz attributes like nodesep and ranksep. I've been trying to read through the networkx documentation online, but for the life of me, I can't figure out how/where to feed the attributes in.

0

There are 0 answers