I have this gv code,
I want to have the horizontal order : 12 13 14 15 23 24
but I get:
23 13 12 24 14 15
graph "tree" {
node [shape=plaintext];
1 [label = "1"]
2 [label = "2"]
3 [label = "3"]
4 [label = "4"]
5 [label = "5"]
12 [label = "12"]
13 [label = "13"]
14 [label = "14"]
15 [label = "15"]
23 [label = "23"]
24 [label = "24"]
1 -- 12;
2 -- 12;
1 -- 13;
3 -- 13;
1 -- 14;
4 -- 14;
1 -- 15;
5 -- 15;
2 -- 23;
3 -- 23;
2 -- 24;
4 -- 24;}
the solution : Force the left to right order of nodes in graphviz? did not work for this case (ordering nodes not edges).
If I add :
{rank = same; 12 13 14 15 23 24; rankdir=LR;}
We get the same unordered nodes:
png file made with:
dot -T png test.gv > test.png