2015-09-15 42 views
1

我想重现使用graphviz在书上看到的特定图形。这是书中的图表:I want this用graphviz重现图形

但使用以下.dot

digraph rf{ 
    rankdir=LR; 
    graph[size="5,5",ratio=fill, overlap=false]; 
    //node[height="2", width="2", fontsize="50"]; 
    //edge[penwidth="4", fontsize="50"] 
    <a>[color=red]; 
    <b>[color=red]; 
    <s>[color=purple]; 
    <t>[color=purple]; 
    <s>-><a>[label="500/0"] 
    <s>-><b>[label="500/0"] 
    <a>-><b>[label="1/0"] 
    <a>-><t>[label="500/0"] 
    <b>-><t>[label="500/0"] 
} 

我得到这个:

I don't want this

注意它是真正的大和种类的扩大,也标签与边缘重叠。

我想得到一本与本书非常相似的图表。

我用绘制该命令:

circo -Tpng errornet2.dot -oerrornet2.png 

希望我能得到一些帮助,谢谢!

回答

1

如果使用dot引擎,而不是圆环和constraint=false在一个边缘,你在那里附近

digraph rf{ 
    rankdir=LR; 
    graph[size="5,5",ratio=fill, overlap=false]; 
    node[height="2", width="2", fontsize="50"]; 
    edge[penwidth="4", fontsize="50"] 
    <a>[color=red]; 
    <b>[color=red]; 
    <s>[color=purple]; 
    <t>[color=purple]; 
    <s>-><a>[label="500/0"] 
    <s>-><b>[label="500/0"] 
    <a>-><b>[label="1/0" constraint=false] 
    <a>-><t>[label="500/0"] 
    <b>-><t>[label="500/0"] 
} 

enter image description here

+0

这是很好的,但为什么你决定使用'约束“在那个特定的边缘? –

+0

如果您忽略约束条件,您会注意到什么? – stefan