Order left to right boxs in dot grahviz

I have this gv code, I want to have the horizontal order :

12 13 14 15 23 24 25 34 35 45;

  but I get:

12 13 23 14 15 24 34 25 35 45

The sample code is on patebin too : http://pastebin.com/cpnCBf8d

graph "tree" { node [shape=plaintext]; 1 -- 12; 1 -- 13; 1 -- 14; 1 -- 15; 2 -- 12; 2 -- 23; 2 -- 24; 2 -- 25; 3 -- 13; 3 -- 23; 3 -- 34; 3 -- 35; 4 -- 14; 4 -- 24; 4 -- 34; 4 -- 45; 5 -- 15; 5 -- 25; 5 -- 35; 5 -- 45; // {rank = same; 12 13 14 15 23 24 25 34 35 45; rankdir=LR;} }

PS: this question is on stackoverflwo too: http://stackoverflow.com/questions/34228322/order-left-to-right-boxs-in-dot-grahviz

AttachmentSize
hasse.txt422 bytes

You need to add a constraint

You need to add a constraint between the nodes. Otherwise, dot will feel free to re-order them when attempting to reduce crossings. Replace you commented line with:

 {rank = same;
  edge[style=invis]
  12 -- 13 -- 14 -- 15 -- 23 -- 24 -- 25 -- 34 -- 35 -- 45
 }

 

Recent comments