I want to make edges overlap in graphviz. But graphviz seems to re-arrange the leaf nodes to avoid overlapping. Can I force graphviz to stop re-arranging the nodes ?

Produced:

Produced

Desired:

Desired

I am using pygraphviz to create the tree.

有帮助吗?

解决方案

The following approach using additional invisible edges works perfectly for this graph:

digraph g{
  Act -> Bore;
  Act -> Cat;
  Bore -> Dog;
  Bore -> Egg [style=invis];
  Bore -> Face;
  Cat -> Egg;
  Cat -> Face [style=invis];
  Cat -> Goat;
}

graphviz output

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top