how to control node position ?

Hello,

I have this diagram, but I need the n node to appear *below* k (for conventional reasons). How can I do that ? I tried "rank", "y", ... to no avail. Is it possible with DOT ?

Thanks in advance

digraph figure1 {
graph [rankdir=TB]
node [rank=same; shape = circle, fixedsize=true, fontname=helvetica, width=0.5]
theta
node [rank=same; shape = box, fontname = Times, style=filled, color='grey80']
n;
node [rank=min; shape = box, fontname = Times, style=filled, rank='source', color='grey80']
k
theta->k
n-> k
}

By default, if you have an

By default, if you have an edge k -> n, n will appear below k. So try

digraph figure1 {
  theta [shape = circle, fixedsize=true, fontname=helvetica, width=0.5]
  n [shape = box, fontname = Times, style=filled, color=grey80]
  k [shape = box, fontname = Times, style=filled, color=grey80]
  theta->k
  k -> n
}

If you want the arrow to point from n to k, set dir=back on the edge. Note that rankdir=TB is the default, only double quotes work for strings, not single quotes, and rank is a (sub)graph attribute, not a node attribute. Also rank=min and rank=source will cause nodes to appear at the top of the drawing (for rankdir=TB).

Recent comments