2016-08-03 61 views
3

以下dotfile正在創造一個巨大的輸出:優化標籤位置的Graphviz

digraph G { 
    "Bob"->"A" [label=" A very long label"] 
    "Bob"->"B" [label=" A very long label"] 
    "Bob"->"C" [label=" A very long label"] 
    "Bob"->"D" [label=" A very long label"] 
    "Bob"->"E" [label=" A very long label"] 
    "Bob"->"F" [label=" A very long label"] 
    "Bob"->"G" [label=" A very long label"] 
} 

輸出是這樣的: Huge graph

有沒有辦法更改標籤,持倉量減少圖形的大小?

回答

1

很簡單\ n溶液

digraph G { 
    "Bob"->"A" [label=" A very\nlong\nlabel"] 
    "Bob"->"B" [label=" A very\nlong\nlabel"] 
    "Bob"->"C" [label=" A very\nlong\nlabel"] 
    "Bob"->"D" [label=" A very\nlong\nlabel"] 
    "Bob"->"E" [label=" A very\nlong\nlabel"] 
    "Bob"->"F" [label=" A very\nlong\nlabel"] 
    "Bob"->"G" [label=" A very\nlong\nlabel"] 
}