title: How can I adjust the nodes in this dot program into a 2 by 3 table?
body: <p>I use graphviz to draw a diagram. </p>
  
  <p><a href="https://i.stack.imgur.com/BkndM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BkndM.png" alt="enter image description here"></a></p>
  
  <p>The placement of the nodes are not ideal. I would like the six nodes to be roughly placed in a 2 by 3 table:</p>
  
  <pre><code>file_in   stdin_in     string_in
  
  file_out  stdout_out   variable_out
  </code></pre>
  
  <p>I have tried to add weights to some edges but still fails to move the nodes into such a table. See my dot program below. Thanks.</p>
  
  <pre><code>digraph G {
  
  /* directly betw inputs */
  node [color=black]
  string_in -&gt; stdin_in [label="redirection"];
   file_in -&gt; stdin_in [label="redirection"];
   stdin_in -&gt; file_in [label="device file /dev/stdin, or arg -", weight=8];
   stdin_in -&gt; string_in [label="xargs"]; 
  
  /* directly betw outputs */
  node [color=red]
  edge [color=red]
    stdout_out -&gt; file_out [label="redirection" fontcolor="red"];
    file_out -&gt; stdout_out [label="/dev/stdout or arg -" fontcolor="red"];
  
  /* directly from input to output */
  edge [color=blue]
   stdin_in -&gt; stdout_out [label="cat or tee" fontcolor="blue" weight=8];
   stdin_in -&gt; file_out [label = "tee &gt; /dev/null" fontcolor = "blue"]; 
   string_in -&gt; stdout_out [label="echo -n" fontcolor="blue" weight=2];
   file_in -&gt; stdout_out [label="cat" fontcolor="blue"];
   file_in -&gt; file_out [label="none" fontcolor="blue"];
   string_in -&gt; variable_out [label="assignment" fontcolor="blue"];
  
  /* directly from output to input */
  edge [color=green]
   stdout_out -&gt; stdin_in [label="pipe" fontcolor="green"];
   stdout_out -&gt; file_in  [label="process substitution"  fontcolor="green"];
   stdout_out -&gt; string_in [label="command substitution"  fontcolor="green"];
   file_out -&gt; file_in [label="none"  fontcolor="green"];
   variable_out -&gt; string_in [label="parameter expansion"  fontcolor="green"];
  }
  </code></pre>