Trying to use rank=same to control ordering of nodes in graphviz see e.g. e.g. I found this extraordinary behaviour. What I want is to get the nodes a, b, and c in the expected order, i.e. a then b then c:
digraph foo{
newrank=true
"o4"->"x3"
"o4"->"x4"
"o5"->"x3"
"o5"->"x4"
subgraph cluster_7 {
"a"->"i"
"b"->"i"
"c"->"i"
}
{rank="same";"a"->"b";"b"->"c"}
}
I see no reason why graphviz would go out of its way to mess up the order of a, b, and c. If I change any aspect of the code, e.g. removing one of the edges between the o nodes and the x nodes, the problem disappears. It also disappears if I delete newrank=true
, but I need this because otherwise the rank=same
specification shifts the nodes out of the subgraph. It disappears if I make the subgraph into an ordinary cluster, i.e. don't start the name with cluster_
but I need this too. It disappears if I delete the rank=same
line but I also need this. Any ideas?