1

I have taken an initial DOT file and modified the pos attributes of some nodes using pydot. Now I want to render an image file that shows the nodes in their new positions. The catch is, I don't want a layout program to mess with the positions! I just want to see the nodes exactly where the pos attribute indicates. I don't care about how the edges look.

I can produce a DOT file with my positions easily using pydot, but I can't figure out how to make an image file, either in pydot or on the command line with dot. Help would be really appreciated! Thanks!

nova
  • 205
  • 1
  • 9

1 Answers1

2

dot.write_png('filename.png')? Or is there something I'm missing?

Also, the neato command-line program has a -n option for graph files that already have layout. The program description says it is for undirected graphs, but I tried it with a digraph and it produced the correct result.

Tim Yates
  • 5,151
  • 2
  • 29
  • 29
  • The problem with `dot.write_png('filename.png')` is that pydot uses a default layout to render the image file. Even with `dot.write_png('filename.png', prog=None)`, I get the default layout. – nova May 18 '11 at 09:07