开发者

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

开发者 https://www.devze.com 2023-01-16 19:06 出处:网络
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

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


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 dot: how to insert arrows from a node to center of an arrow

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


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:

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

0

精彩评论

暂无评论...
验证码 换一张
取 消