2017-02-09 107 views
1

我想在Graphviz上使用傾斜的多邊形(又名平行四邊形),問題是平行四邊形邊框和文本之間存在太多空間。Graphviz:減少傾斜的多邊形節點上的邊距

digraph G { 
    poly1[margin=0, width=0, height=0, shape=polygon, label="This is a polygon\nwithout skew"] 
    poly2[margin=0, width=0, height=0, shape=polygon, label="This is a polygon\nwith skew", skew=0.3] 
} 

這是以前的代碼的結果:

Graphviz polygon w/ and w/o skew

正如你所看到的,一旦我設置的傾斜值(在這種情況下skew=0.3)多邊形內部利潤率增加了很多。設置margin=0width=0height=0不能解決問題。

有沒有辦法去除多邊形的內邊距?

回答

0

有一種方法,但它是不漂亮:

digraph G { 
    poly1[margin=0, width=0, height=0, shape=polygon, label="This is a polygon\nwithout skew"] 
    poly2[margin=0, width=1.8, height=0.46, shape=polygon, fixedsize=true, label="This is a polygon\nwith skew", skew=0.3] 
} 

添加fixedsize=true和(通過試驗和錯誤)指定節點的寬度和高度產生這樣的:

skewed result :)