我正在创建一个带有手动定位节点的图形,并在它们之间使用splines=“弯曲”类型的边。
digraph graphname {
splines="curved";
node[shape = box, margin="0.03,0.03", fontsize=11, height=0.1, width=0.1, fixedsize=false];
"LeftFoot\nRightHand" [pos="-150,-150!"];
"RightFoot\nRightHand" [pos="-90,-150!"];
"LeftFoot\nRightFoot" [pos="0,-150!"];
...
edge[style = solid,fontsize=11];
"LeftFoot\nRightFoot":n -> "RightFoot\nRightHand":n [label = "3", penwidth = 1, color = "red"];
"LeftFoot\nRightFoot":s -> "LeftFoot\nRightHand":s [label = "7", penwidth = 1, color = "red"];
...
}问题是其中一条边弯曲到了错误的一侧,所以它通过了一个节点:

有没有简单的方法来解决这个问题,比如TikZ中的“向左弯曲”或“向右弯曲”?
我尝试在边上使用pos属性来设置样条线控制点来更改折弯,但是这看起来根本不会更改边。
发布于 2020-06-19 18:51:33
在Grapvhiz 2.38中,这个问题似乎已经解决了。我稍微缩放了pos,但保留了代码的其余部分:
点源码:
digraph graphname {
splines="curved";
node[shape = box, margin="0.03,0.03", fontsize=11, height=0.1, width=0.1, fixedsize=false];
"LeftFoot\nRightHand" [pos="-2,-2!"];
"RightFoot\nRightHand" [pos="-1.2,-2!"];
"LeftFoot\nRightFoot" [pos="0,-2!"];
edge[style = solid,fontsize=11];
"LeftFoot\nRightFoot":n -> "RightFoot\nRightHand":n [label = "3", penwidth = 1, color = "red"];
"LeftFoot\nRightFoot":s -> "LeftFoot\nRightHand":s [label = "7", penwidth = 1, color = "red"];
}命令:
dot -Kneato -Tpng input.gv > output.png输出:

https://stackoverflow.com/questions/30916979
复制相似问题