Due to organizational changes, the Graphviz web site will see some modifications in the near future. In particular, it will probably no longer provide binary packages for Windows and Macs. The latter can be obtained via Macports or Home Brew. If someone wants to set up Appveyor for Windows, we would be grateful. |

# layout different after saving through -dot using fdp

Submitted by ds on Fri, 06/03/2016 - 14:55

New question from a newbie to the forum.

I am using:

fdp -T svg -o out.svg in.dot

If instead I write to an intermediate dot file e.g.:

fdp -T dot -o mid.dot in.dot

followed by:

fdp -s -T svg -o out.svg mid.dot

I get very different graphs. Can someone please explain why this is so, or what I can do to change this behavior so the two give the same result? I'm trying to update the graph and this is killing me.

Thanks.

## Recent comments

- update

18 weeks 3 days ago - re: yum install - Error downloading packages

26 weeks 4 days ago - yum install - Error downloading packages

27 weeks 10 hours ago - Hi,
Sorry, I was a little

28 weeks 20 hours ago - The difficulties you are

32 weeks 2 days ago - Is there a question?

35 weeks 6 days ago - same problem: png not recognized

36 weeks 13 min ago - Thank you

36 weeks 2 days ago - The obvious answer is that

36 weeks 2 days ago - There is no real time help.

36 weeks 2 days ago

## When you fdp -T svg -o

When you fdp -T svg -o out.svg in.dot, fdp draws the graph using random positions for the nodes and then applies the force-directed algorithm

When you do the second approach: fdp min.dot | fdp -s -Tsvg -o out.svg, fdp uses the positions from the first run as the starting point for the second run, and then applies the force-directed algorithm. So, of course, the layouts will be different. Indeed, even without position info, fdp chooses a random initial layout, so two runs

fdp in.dot

fpd in.dot

will potentially produce different layouts.

If you don't want to change the layout, but just render the graph, use neato -n or neato -n2. These assume the input graph has its node (and edge) coordinates specified, and just renders the output.