【发布时间】:2021-01-25 13:41:42
【问题描述】:
我正在使用graphviz,但是我想将节点“This on top”强制到页面顶部,而不是侧面。这是图表:
这是代码:
g= Digraph('trial', filename='trial.gv')
g.attr(compound='true', rankdir="TB" )
with g.subgraph() as s:
s.attr(rank='max')
s.node('This on top ')
s.edge('this right under', "Fabrication")
with g.subgraph(name='cluster0') as c:
c.node("This")
c.node("that")
c.node("and this on the same level")
g.edge("this right under","that", lhead="cluster0" )
g.edge("that","This on top ", ltail="cluster0" )
g
是否有命令确保节点按我希望的 TOP/Bottom 顺序显示?
【问题讨论】:
标签: python graphviz pygraphviz