根据实验,似乎只有这样才能获得
wf:sw -> wf:se [dir = both]
做你想做的就是添加
graph [rankdir=TB]
不幸的是,rankdir 会影响整个图(不仅仅是子图或集群)。所以你可以修复一个循环,但你会破坏另一个循环。
我发现实现您的目标的唯一方法是手动修改违规边缘(样条)的 pos。这个:
digraph stackex {
graph [bb="0,0,82.583,216"];
node [label="\N",
shape=square
];
bf [height=0.5,
pos="41.292,162",
shape=ellipse,
width=0.75];
bf:nw -> bf:ne [dir=both,
pos="s,26.292,177 e,56.292,177 22.277,186.17 18.135,200.16 21.792,216 41.292,216 60.792,216 64.448,200.16 60.306,186.17"];
i1 [height=0.5,
label=X1,
pos="41.292,90",
width=0.5];
bf -> i1 [pos="e,41.292,108.1 41.292,143.7 41.292,135.98 41.292,126.71 41.292,118.11"];
wf [height=0.5,
pos="41.292,18",
shape=ellipse,
width=0.75];
i1 -> wf [dir=back,
pos="s,41.292,71.697 41.292,61.665 41.292,53.054 41.292,43.791 41.292,36.104"];
wf:se -> wf:sw [dir=both,
pos="s,56.292,3 e,26.292,3
65.002,8.3185
92.908,0.389
88.823,-20
41.292,-20
-6.2395,-20
-10.324,0.389
17.582,8.3185"];
}
还有这个命令
neato -n2 -Tpng doubleheaded3.fixed.dot >doubleheaded3.fixed.png
给出了这个:
总而言之,我建议使用 pic/gpic/dpic 语言。级别较低,但从长远来看可能更易于使用。