File tree 1 file changed +23
-1
lines changed
1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -1599,7 +1599,29 @@ Home:[https://github.com/pygraphviz/pygraphviz]
1599
1599
1600
1600
[https://en.wikipedia.org/wiki/Graphviz Graphviz ] 是一个功能很强大的关系图【自动】生成工具,具体介绍可以参见俺的博文(在“[https://program-think.blogspot.com/2016/02/opensource-review-graphviz.html 这里 ]”)
1601
1601
1602
- 这个库如其名所示,提供了 Python 对 Graphviz 的封装。
1602
+ 这个库如其名所示,提供了 Python 对 Graphviz 的封装(基于 SWIG)。
1603
+
1604
+ <h4>Graphviz</h4>
1605
+
1606
+ Home:[https://github.com/xflr6/graphviz]
1607
+
1608
+ 这个库与上一个类似,也提供了 Graphviz 的 Python 的封装。
1609
+
1610
+ 这两个库都在 GitHub 上。(可能是因为出现较晚)这个库的 Star 和 Fork 数都不如上一个,不过俺感觉文档比较全。
1611
+
1612
+ 代码示例——创建一个 DOT 图并加入若干节点和连线
1613
+ <source lang="python">
1614
+ from graphviz import Digraph
1615
+
1616
+ dot = Digraph(comment='The Round Table')
1617
+ # 添加节点
1618
+ dot.node('A', 'King Arthur')
1619
+ dot.node('B', 'Sir Bedevere the Wise')
1620
+ dot.node('L', 'Sir Lancelot the Brave')
1621
+ # 添加连线
1622
+ dot.edges(['AB', 'AL' ])
1623
+ dot.edge('B', 'L', constraint='false')
1624
+ </source>
1603
1625
1604
1626
== 10.2 图像格式转换 ==
1605
1627
You can’t perform that action at this time.
0 commit comments