dot (graphviz): how to enforce position of nodes on x-axis?

2

I have a simple digraph that is supposed to represent a lattice - a graph where the nodes correspond to points in time and arcs represent words. Some 100 to 1000 nodes and about as many arcs.

Example structure:

Lattice

For each node, I have an exact time stamp, so I would like to force dot to put the nodes on an exact position on the x-axis

Here is my toy example:

digraph {
  rankdir="LR";
  0 -> 1 [label="cat"]
  0 -> 2 [label="can"]
  1 -> 3 [label="is"]
  2 -> 3 [label="has"]
}

You can see it in an online dot editor here.

How can I define the position on the x-axis of nodes 1 and 2 (e.g. to make 2 appear further to the right than 1)?

Pavel

Posted 2019-02-28T19:22:02.153

Reputation: 314

No answers