Reputation: 455
I have the following graph
The dot file I used to generate is:
strict graph G {
ratio=1;
0 -- 1;
0 -- 4;
1 -- 5;
1 -- 2;
2 -- 6;
2 -- 3;
3 -- 7;
4 -- 8;
4 -- 5;
5 -- 9;
5 -- 6;
6 -- 10;
6 -- 7;
7 -- 11;
8 -- 12;
8 -- 9;
9 -- 13;
9 -- 10;
10 -- 14;
10 -- 11;
11 -- 15;
12 -- 13;
13 -- 14;
14 -- 15;
}
How do I force the output of the command dot -Tpdf test.dot -o test.pdf
to be a square graph, instead of this diamond like shape?
Upvotes: 0
Views: 951
Reputation: 3759
by subgraph with rank=same
strict graph G {
ratio=1;
{0 1 2 3 rank=same}
{4 5 6 7 rank=same}
{8 9 10 11 rank=same}
{12 13 14 15 rank=same}
0 -- 1;
0 -- 4;
1 -- 5;
1 -- 2;
2 -- 6;
2 -- 3;
3 -- 7;
4 -- 8;
4 -- 5;
5 -- 9;
5 -- 6;
6 -- 10;
6 -- 7;
7 -- 11;
8 -- 12;
8 -- 9;
9 -- 13;
9 -- 10;
10 -- 14;
10 -- 11;
11 -- 15;
12 -- 13;
13 -- 14;
14 -- 15;
}
Upvotes: 1