(二)Graphivz 簡單結構圖及子圖

一、簡單數據結構圖

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;}

650) this.width=650;" src="http://img1.51cto.com/attachment/201309/113003989.png" title="7.png" alt="113003989.png" />


二、子圖

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;    }             }

650) this.width=650;" src="http://img1.51cto.com/attachment/201309/131744355.png" title="10.png" alt="131744355.png" />

畫一個子圖就是subgraph cluster#,必須有cluster 前綴。



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章