2011-09-09 82 views

回答

14

你可以用style來做到這一點。

示例使用style=invis

digraph g{ 
subgraph cluster0 { 
    style=invis; 
    1 -> 2; 
} 
} 

如果您想以此爲所有子圖默認情況下,使用subgraph[style=invis]

digraph g{ 
subgraph[style=invis]; 

subgraph cluster0 { 
    1 -> 2; 
} 
} 
+0

有關子圖[style = invis]的任何提示?將這一行添加到我的圖表頂部只是給我一個語法錯誤。 – Dimpl

+3

'graph [style = invis]'也可以工作 – marapet

+0

謝謝,這是有效的。 style = invis在主圖中也可以設置默認值: digraph g {0}風格= invis; 子圖簇0 { 1 - > 2; } } – Dimpl

4

您可以使用style=invis

subgraph cluster1 { 
    style=invis 
    ... 
} 

作爲上述style=invis方法的替代方案,您還可以設置pencolor=transparent(本地或全局)。

+0

'style = invis'方法不再是「上面」,我將編輯答案 – mirelon

+1

非常感謝!與''style = invis''相反,''pencolor = transparent''實際上保留了子圖的標籤。 – MisterMiyagi

0

這可以通過使用penwidth = 0屬性來完成。這既不會影響標籤文本,也不會更改羣集的邊界框。

儘管style = hiddenpencolor = transparent屬性在大多數情況下都有效,但可能需要避免壓縮集羣標籤並在集羣周圍留下透明線。