File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ digraph G {
2+ 魔兽争霸3 -> XHero;
3+ 魔兽争霸3 -> 超级战舰;
4+ XHero -> Footman;
5+ Footman -> 刀塔;
6+ }
Original file line number Diff line number Diff line change 11第一章 快速入门
22==============================================================================
33
4- 画一个简单的有向图
4+ 1.1 画一个简单的有向图
55------------------------------------------------------------------------------
66
77Graphviz 编译的源文件是 dot 文件,把如下的代码保存到 graph01.dot 文件。
@@ -27,7 +27,7 @@ Graphviz 编译的源文件是 dot 文件,把如下的代码保存到 graph01.
2727.. image :: _static/examples/graph01.jpg
2828
2929
30- 让有向图更复杂点
30+ 1.2 让有向图更复杂点
3131------------------------------------------------------------------------------
3232
3333Graphviz 可以给点(node)或者线(edge)添加格式。
@@ -57,3 +57,24 @@ Graphviz 可以给点(node)或者线(edge)添加格式。
5757.. image :: _static/examples/graph02.jpg
5858
5959
60+ 1.3 支持中文
61+ ------------------------------------------------------------------------------
62+
63+ Graphviz 支持 UTF8 下的 中文。
64+
65+ .. code-block :: none
66+ :linenos:
67+ :caption: graph03.dot
68+ :name: Graph 03
69+
70+ digraph G {
71+ 魔兽争霸3 -> XHero;
72+ 魔兽争霸3 -> 超级战舰;
73+ XHero -> Footman;
74+ Footman -> 刀塔;
75+ }
76+
77+ 使用命令 `dot -Tjpg graph03.dot -o graph03.jpg ` 可以得到如下的图片:
78+
79+ .. image :: _static/examples/graph03.jpg
80+
You can’t perform that action at this time.
0 commit comments