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

浪子不回头ぞ 提交于 2019-12-05 02:52:54

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:

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:

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!