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

- If you run dot.exe -V, this

4 days 14 hours ago - Not sure

5 days 7 hours ago - What version of Graphviz are

5 days 14 hours ago - update

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

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

35 weeks 5 hours ago - Hi,
Sorry, I was a little

36 weeks 15 hours ago - The difficulties you are

40 weeks 2 days ago - Is there a question?

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

43 weeks 6 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.