Closed ninjakx closed 3 years ago
from graphviz import Graph, Source g = Graph('G', filename='process.gv', engine='sfdp') g.edge('run', 'intr') g.edge('intr', 'runbl') g.edge('runbl', 'run') g.edge('run', 'kernel') g.edge('kernel', 'zombie') g.edge('kernel', 'sleep') g.edge('kernel', 'runmem') g.edge('sleep', 'swap') g.edge('swap', 'runswap') g.edge('runswap', 'new') g.edge('runswap', 'runmem') g.edge('new', 'runmem') g.edge('sleep', 'runmem') g
Source(g)
Using Source graph more look like a tree.
Source
The example uses engine='sfdp', so you need to set the same engine if you want to reproduce with Source :
engine='sfdp'
>>> Source(g, engine='sfdp')
See also graphviz-engines.ipynb and manual.html#engines.
Using
Source
graph more look like a tree.