2

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.

  • If you don't get answers here, you might want to try tex.stackexchange, I've seen many people doing awesome things with graphviz there. – Pacane Jul 23 '13 at 19:35
  • @Pacane This is *definitely* not on-topic at TeX.SX -- it's not about TeX systems at all. I mean, we could give you a TikZ/PSTricks/Metapost solution in a heartbeat, but Graphviz only uses LaTeX as an export format. This is the best place to find an answer (740 tagged compared to SU's 13). Avalokitesvara, [please do not cross-post](http://tex.stackexchange.com/questions/125191), one of the moderators can move the question for you if need be. Even so, I think this question belongs right here. – Sean Allred Jul 24 '13 at 00:10
  • @Sean I am sorry for the cross-posting. Let the topic stay here at stack overflow. – Avalokitesvara Jul 24 '13 at 00:18
  • Related: [How to force node position (x and y) in graphviz](http://stackoverflow.com/questions/5343899/how-to-force-node-position-x-and-y-in-graphviz) – Sean Allred Jul 24 '13 at 00:28
  • @Sean Thanks Sean. I saw that earlier. But I use the dot layout. The Pos thing only words for neato, it doesn't work for dot :-/ – Avalokitesvara Jul 24 '13 at 00:42
  • Yeah sorry, I thought of Tikz... My bad. – Pacane Jul 24 '13 at 14:04

1 Answers1

2

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

marapet
  • 54,856
  • 12
  • 170
  • 184