纠正 graphviz 线

Rectify graphviz lines

我正在尝试创建一个看起来像不断延伸的格子的图形。这是我的代码:

graph G {
0 [label=""];
1 [label=""];
2 [label=""];
3 [label=""];
4 [label=""];
5 [label=""];
6 [label=""];
7 [label=""];
8 [label=""];
9 [label="", shape="none"];
10 [label="", shape="none"];
11 [label="", shape="none"];
12 [label="", shape="none"];
13 [label="", shape="none"];
14 [label="", shape="none"];
15 [label="", shape="none"];
16 [label="", shape="none"];
17 [label="", shape="none"];
18 [label="", shape="none"];
19 [label="", shape="none"];
20 [label="", shape="none"];
0 -- 1;
0 -- 2;
0 -- 3;
0 -- 4;
1 -- 5;
2 -- 5;
2 -- 6;
3 -- 6;
3 -- 7;
4 -- 7;
4 -- 8;
1 -- 8;
1 -- 9;
2 -- 10;
3 -- 11;
4 -- 12;
5 -- 13;
6 -- 14;
7 -- 15;
8 -- 16;
5 -- 17;
6 -- 18;
7 -- 19;
8 -- 20;
}

但是,这会产生如下输出:

有没有办法把角节点上的边修整一下,让它看起来更规则?

好吧,我最后添加了一些不可见的顶点和不可见的边,这很有效。虽然这不是最优雅的解决方案。

graph G {
ratio="fill";
margin=0;
0 [label=""];
1 [label=""];
2 [label=""];
3 [label=""];
4 [label=""];
5 [label=""];
6 [label=""];
7 [label=""];
8 [label=""];
9 [label="", shape=none];
10 [label="", shape=none];
11 [label="", shape=none];
12 [label="", shape=none];
13 [label="", shape=none];
14 [label="", shape=none];
15 [label="", shape=none];
16 [label="", shape=none];
17 [label="", shape=none];
18 [label="", shape=none];
19 [label="", shape=none];
20 [label="", shape=none];
0 -- 1;
0 -- 2;
0 -- 3;
0 -- 4;
1 -- 5;
2 -- 5;
2 -- 6;
3 -- 6;
3 -- 7;
4 -- 7;
4 -- 8;
1 -- 8;
1 -- 9;
2 -- 10;
3 -- 11;
4 -- 12;
5 -- 13;
6 -- 14;
7 -- 15;
8 -- 16;
5 -- 17;
6 -- 18;
7 -- 19;
8 -- 20;
11 -- 18 [style=invis];
14 -- 10 [style=invis];
10 -- 17 [style=invis];
13 -- 9 [style=invis];
9 -- 16 [style=invis];
20 -- 12 [style=invis];
12 -- 15 [style=invis];
19 -- 11 [style=invis];
}