首页 > 解决方案 > 节点之间的 Graphviz 边缘绘制错误

问题描述

graphivz 显示了生成图形的奇怪行为。节点 5 到 6 之间的连接从 5.south 到 6.east,但我想要 5.west 到 6.north。此外,从 7.west 到 16.north,16.north 位置没有居中。我做错了什么? 边缘绘制错误

另一方面,使用网站https://graphs.grevian.org生成的图表看起来不错并且满足我的所有要求。 边缘正确绘制

这是用于生成两张图片的代码示例:

digraph G {
pencolor=transparent;
graph [splines=ortho];
subgraph cluster1 {
1->2->3->4->5;
}
subgraph cluster2 {
6->7->8->9->10.1;
}
subgraph cluster3 {
11->12->13->14->15;
}
subgraph cluster4 {
16->17->18->19->20;
}
subgraph cluster5 {
21->22->23->24->25
}
1->11;
3->21;
5->6;
1 [label="1-1"];
7->16;
}

在我的系统 ubuntu 18.04.03 LTS 上安装了 graphviz 2.40.1-2。在我使用的终端中

dot -Tpng graph_G.dot -o graph_G.png

标签: graphvizedges

解决方案


推荐阅读