layout different after saving through -dot using fdp

New question from a newbie to the forum.

I am using:

fdp -T svg -o out.svg

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

fdp -T dot -o

followed by:

fdp -s -T svg -o out.svg

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.


When you fdp -T svg -o

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

When you do the second approach: fdp | 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



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.

Recent comments