title: graphviz state machine with self loops
body: <p>I am trying to create a state machine diagram using graphviz and I am having trouble making it display nicely.</p>
  
  <p>This is the diagram described in dot language:</p>
  
  <pre><code>digraph finite_state_machine {
      node [shape = point];
      PWRON
  
      node [shape=circle];
      PWROFF [fontsize=10]
  
      PWRON  -&gt; BOOT     [label="start_boot_timer"]
  
      BOOT   -&gt; HOME   [label="boot_timer_expires"]
      HOME   -&gt; HOME   [label="home to home 1"]
      HOME   -&gt; HOME   [label="home to home 2"]
      HOME   -&gt; HOME   [label="home to home 3"]
  
      HOME   -&gt; BLEADV [label="short_button_press"]
      BLEADV -&gt; BLECON [label="ble_conn_event"]
      BLECON -&gt; HOME   [label="ble_conn_close"]
  
      HOME   -&gt; PWROFF [label="power off"]
  }
  </code></pre>
  
  <p>The drawn diagram looks like:</p>
  
  <p><img src="https://i.stack.imgur.com/A1Puq.png" alt="The drawn diagram looks like this"></p>
  
  <p>I am a complete newbie in dot/graphviz, can you help me present it better?</p>
  
  <p>The main problems currently are:<br>
  * the self loops from home to home all overlapping<br>
  * the placement of BLEADV and BLECON is not very good (lesser priority)</p>