【问题标题】:Positioning of graphviz nodes with Python使用 Python 定位 graphviz 节点
【发布时间】:2017-03-13 16:40:45
【问题描述】:

使用此代码:

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()

我可以创建以下输出:

但我需要“测试”字段下方的“序列”字段。如何做到这一点?

【问题讨论】:

    标签: python graphviz dot


    【解决方案1】:

    可以用不可见的边缘来完成:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-12-18
      • 2013-03-23
      • 2016-04-17
      • 2019-08-29
      • 1970-01-01
      • 1970-01-01
      • 2021-12-08
      相关资源
      最近更新 更多