rankdir

Sets direction of graph layout

type: rankdir, default: TB

For example, if rankdir="LR", and barring cycles, an edge T -> H; will go from left to right. By default, graphs are laid out from top to bottom.

This attribute also has a side-effect in determining how record nodes are interpreted. See record shapes.

Top to bottom (default)
digraph {
    rankdir="TB"
    a -> b -> c;
}
Bottom to top
digraph {
    rankdir="BT"
    a -> b -> c;
}
Left to right
digraph {
    rankdir="LR"
    a -> b -> c;
}
Right to left
digraph {
    rankdir="RL"
    a -> b -> c;
}
Valid on:
  • Graphs

Note: dot only.

Search the Graphviz codebase for "rankdir"