kame
kame

Reputation: 22010

Positioning of graphviz nodes with Python

With this code:

from graphviz import Graph, Digraph
g = Digraph('G', filename='process.gv', engine='dot')

g.node('Tests')
g.node('Devices')

# Tests
g.edge('TestName', 'Tests')

# Devices
g.edge('Serial', 'Devices')

g.view()

I can create the following output:

enter image description here

But I need the field "Serial" below the field "Tests". How to do this?

Upvotes: 4

Views: 784

Answers (1)

Ohjeah
Ohjeah

Reputation: 1307

It can be done with an invisible edge:

g.edge('Tests', 'Serial', style="invis")

enter image description here

Upvotes: 4

Related Questions