I'm using Digraph from graphviz module in python to visualize a tree.
I create nodes by Digraph.node()
and create edges by Digraph.edge()
.
I want to specify which one should be right node and which one should be left node. But automatically it set first created node as left child and second created node as right child.
For example in this code:
from graphviz import Digraph
test = Digraph()
test.node('a')
test.node('b')
test.node('c')
test.edge('c', 'b')
test.edge('c', 'a')
test
Output is:
I want 'b' node be left child and 'a' node be right child like this:
I should emphasis I couldn't create 'b' node first then create 'a' node.
Is there any way to do this for me with this library or not? If there isn't any solution for this module, recommend another module please.