是否有可能强制graphviz在此图顶部放置节点" a" ?我尝试过 neato 和 fdp 。
{{1}}
答案 0 :(得分:1)
如果您想使用neato,可以尝试使用pos
属性:
digraph G {
"a" [pos="0,2!"];
"b";
"c";
"d";
"e";
"a" -> "b";
"a" -> "d";
"a" -> "a";
"b" -> "c";
"c" -> "d";
"d" -> "e";
"e" -> "a";
}
使用dot
布局时,您可以围绕边缘方向切换,以确保a
保持在最顶层:
digraph G {
"a";
"b";
"c";
"d";
"e";
"a" -> "b";
"a" -> "d";
"a" -> "a";
"b" -> "c";
"c" -> "d";
"d" -> "e";
"a" -> "e" [dir=back];
}