GraphViz, grouping the same edges

孤人 提交于 2019-12-17 16:26:57

问题


digraph G {
  a -> b [ label = "foo" ];
  a -> b [ label = "bar" ];
}

This will create two edges between the 'a' and 'b' nodes. Is there a way to have only one edge (group them)?


回答1:


I think it really depends on what your desired output would be. One possibility is:

digraph G {
   graph [ splines = false ]
   a -> b [ label = "foo" ];
   a -> b [ label = "bar" ];
 }

Where not using splines draws edges with straight line segments and so duplicate edges will not be distinguished visually.

In your ideal output, what would the single edge look like since there are to be two different labels for it?




回答2:


The "strict" keyword may help you.

strict digraph G {
  a -> b [ label = "foo" ];
  a -> b [ label = "bar" ];
}

This will combine the edges. But I believe it will only apply the first label.



来源:https://stackoverflow.com/questions/2324486/graphviz-grouping-the-same-edges

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