一、簡單數據結構圖
digraph structs { node [shape=record]; struct1 [shape=record,label="<f0> left|<f1> mid\ dle|<f2> right"]; //record圖形,三個屬性f0,f1,f2 struct2 [shape=record,label="<f0> one|<f1> two"]; struct3 [shape=record,label="hello\nworld |{ b |{c|<here> d|e}| f}| g | h"]; struct1 -> struct2:f1; //指向struct2 的f1屬性 struct1 -> struct3;}
二、子圖
digraph g { subgraph cluster0 { //我是一個子圖,subgraph定義了我, node[style = filled, color = white]; //我之內的節點都是這種樣式 style = filled; //我的樣式是填充 color = lightgrey; //我的顏色 a0->a1->a2->a3; label = "prcess #1" //我的標題 } subgraph cluster1 { //我也是一個子圖 node[style = filled]; b0->b1->b2->b3; label = "process #2"; color = blue; } }
畫一個子圖就是subgraph cluster#,必須有cluster 前綴。