I have the following graph (and accompanying dot file)

there is original picture

digraph G { 
  a -> c; 
  a -> d; 
  a -> q; 
  a -> x;
  a -> qp; 
}

I want to organize the nodes in the graph "chess style view", like this: Chess style

How can this be achieved?

有帮助吗?

解决方案

Depending on what exactly your finally after, an other layout algorithm could work for you:

neato -Tpng yourgraph.gv

neato output


The unflatten utility may be a more appropriate solution in some cases:

unflatten -f -l 2 yourgraph.gv | dot -Tpng -o unflattened.png

unflattened graph

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top