2013-08-19 33 views
0

我正在嘗試製作流程圖。在這個流程圖中,我想要使用不同標籤的盒裝節點(因此標籤大小不同),但我希望節點具有相同的大小。製作相同寬度的框

的源代碼如下:

digraph G { 

    a0 [ label="this is a loooong label" ] 
    a3 [ label="short label" ] 

    b0 [ label="this is a long label" ] 
    b3 [ label="short label" ] 

    a0, a1, a2, a3 [ shape=box ] 
    b0, b1, b2, b3 [ shape=box ] 

    subgraph cluster_one { 
     style=filled; 
     color=lightgrey; 

     a0 -> a1 -> a2 -> a3; 

     label = "This is nice and grey"; 
    } 

    subgraph cluster_two { 
     b0 -> b1 -> b2 -> b3; 
     label = "This is nice and white"; 
     color=blue; 
    } 

} 

我得到這個圖片:

Flowchart

我想在子圖框具有相同的寬度。我怎樣才能做到這一點?

預先感謝您:)

回答

2

您可以通過node [width=5]爲節點設置的默認值。這設定了最小尺寸。如果你設置了fixed-size=true這將是實際尺寸。

0

你可以定義一個全局節點的風格,就像這樣:

digraph G { 

    node[width=4] 
    ...