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

3 weeks 3 days ago - Double edges: even with latest version

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

13 weeks 11 hours ago - Not sure

13 weeks 1 day ago - What version of Graphviz are

13 weeks 1 day ago - update

38 weeks 6 days ago - re: yum install - Error downloading packages

47 weeks 8 hours ago - yum install - Error downloading packages

47 weeks 3 days ago - Hi,
Sorry, I was a little

48 weeks 3 days ago - The difficulties you are

1 year 4 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.