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

- This is a bug that has been

12 weeks 2 hours ago - Double edges: even with latest version

12 weeks 3 hours ago - If you run dot.exe -V, this

21 weeks 4 days ago - Not sure

21 weeks 4 days ago - What version of Graphviz are

21 weeks 5 days ago - update

47 weeks 2 days ago - re: yum install - Error downloading packages

1 year 3 weeks ago - yum install - Error downloading packages

1 year 3 weeks ago - Hi,
Sorry, I was a little

1 year 4 weeks ago - The difficulties you are

1 year 9 weeks 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.