Avalokitesvara
Avalokitesvara

Reputation: 97

How to make edges overlap in Graphviz?

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.

Upvotes: 2

Views: 1172

Answers (1)

marapet
marapet

Reputation: 56486

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

Upvotes: 2

Related Questions