gpt4 book ai didi

graphviz - 奇怪的图形边缘重叠

转载 作者:行者123 更新时间:2023-12-01 05:11:13 29 4
gpt4 key购买 nike

我得到了一个奇怪的图形布局,边缘重叠。

节点“5”似乎放置在错误的位置:

Default messy version

如果我用节点“5”和节点“h”之间的边强制正确的位置,一切都很好:

Fixed version

为什么默认布局如此凌乱?

这是我的点源(只需取消注释即可获得固定版本):

digraph dummy {

subgraph line1 { rank = same
"1", "a", "b", "c", "d", "e", "f", "17"
}

subgraph line2 { rank = same
"9", "g", "11"
}

subgraph line3 { rank = same
"3", "h", "i", "14"
}

"c" -> "d"
"a" -> "b"
"b" -> "c"
"e" -> "f"
"i" -> "14"
"14" -> "f"
"a" -> "3"
"3" -> "h"
"d" -> "9"
"9" -> "g"
"h" -> "i"
"g" -> "i"
"d" -> "e"
"g" -> "11"
"11" -> "e"
"b" -> "5"
#"5" -> "h" # Uncomment to "fix"
"c" -> "7"
"f" -> "17"
"1" -> "a"
"h" -> "13"
"i" -> "15"
"i" -> "15bis"
"i" -> "16"
}

在@Sisyphus 的帮助下,我可以获得更好的结果(但是节点“11”和“g”被无故切换):

enter image description here

最佳答案

改变

subgraph line2 { rank = same
"9", "g", "11"
}


{ rank = same
rankdir=LR
5->7->9->g->11[color=white]
}

这个地方节点“5”正确,但“9”和“g”错了。

关于graphviz - 奇怪的图形边缘重叠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24745393/

29 4 0
文章推荐: jquery - 如何使用 jQuery 将
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com