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

2

12

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

Silassilastic answered 15/9, 2010 at 13:26 Comment(0)
P
12

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.

Portamento answered 8/1, 2011 at 16:49 Comment(0)
S
6

The following prevents "cracked" arrows. Dot unfortunately introduces a kink between the a -> ab and ab->b edges. Not aware of a layout algorithm that prevents this.

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

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

Output:

alt text

Signorino answered 15/9, 2010 at 19:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.