Graphviz graph to horizontal
Asked Answered
H

1

7

I have seen answers at stack overflow that suggest to use:-

rankdir="LR

but they didn't work on this script of mine.

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("a.gv", view=True)

If I add this line:-

dot=Digraph(rankdir="LR)

it throws error that there is no attribute of digraph named "rankdir".

I want to convert my vertical graph to horizontal graph, any help will be much appreciated!! Thanks.

Hankhanke answered 25/6, 2019 at 15:1 Comment(0)
K
9

try:

dot = Digraph(graph_attr={'rankdir':'LR'})
Kweiyang answered 25/6, 2019 at 15:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.