Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

graphviz dot: how to insert arrows from a node to center of an arrow

Tags:

graphviz

dot

I try to create diagrams for MPLUS analyses with dot from the graphviz package. Does anybody have experience with using dot to visualize structural equation models/latent class mixture models? There is especially one feature that I can't figure out how to do beautifully:

I need arrows from nodes to the center of another arrow like

           C
           |
           |
           V
   A ------------> B

I tried to insert an invisible node at the intersection of the arrows. This, however, results in a "cracked" A--->B arrow because dot does represent it as two independent arrows. Is this even possible with dot?

Thanks for suggestions and help!

Gregor

like image 311
gregor Avatar asked Sep 15 '10 13:09

gregor


1 Answers

Building on spenthil's answer to get rid of the kink:

digraph {
  ab[label="", fixedsize="false", width=0, height=0, shape=none];

  a -> ab[arrowhead=None];
  ab -> b;
  c -> ab;

  {rank=same; a; ab; b};
}

Output:

graphviz output

An other possibility would be to play with the weight attribute of the edges to straighten out edges.

like image 92
marapet Avatar answered Oct 21 '22 03:10

marapet