title: Graphviz graph to horizontal
body: <p>I have seen answers at stack overflow that suggest to use:-</p>
  <pre><code>rankdir=&quot;LR
  </code></pre>
  <p>but they didn't work on this script of mine.</p>
  <pre><code>from graphviz import Digraph
  
  
  dot = Digraph()
  dot.node('A', '(3904,1) (Input)')
  dot.node('B', '(3904,64) LSTM layer 1')
  dot.node('C', '(3904,128) LSTM layer 2')
  
  dot.edges(['AB', 'BC'])
  
  dot.render(&quot;a.gv&quot;, view=True)
  </code></pre>
  <p>If I add this line:-</p>
  <pre><code>dot=Digraph(rankdir=&quot;LR)
  </code></pre>
  <p>it throws error that there is no attribute of digraph named &quot;rankdir&quot;.</p>
  <p>I want to convert my vertical graph to horizontal graph, any help will be much appreciated!! Thanks.</p>