0
我想強制節點在圖中有一個指定的位置。這樣做時,不同的子圖不能正確對齊。生成該圖的代碼是:Graphviz子圖對齊問題
dot -Kfdp -n -Tpng -o sample.png test2.dot
輸出圖爲: http://imageshack.us/photo/my-images/826/samplebg.png/ 與我得到的輸出的問題是:
digraph {
rankdir=LR;
labeljust="l";
subgraph cluster0{
label="t=0"
n_3_0_0[label="192.168.8.6"
pos="15,12!"
];
n_3_0_1[label="192.168.8.3"
pos="10,10!"
];
n_3_0_0 -> n_3_0_1 ;
n_3_0_1 -> n_3_0_0 ;
};
subgraph cluster1{
label="t=5"
n_3_1_0[label="192.168.8.6"
pos="15,12!"
];
n_3_1_1[label="192.168.8.3"
pos="10,10!"
];
n_3_1_2[label="192.168.8.9"
pos="10,12!"
];
n_3_1_0 -> n_3_1_1 ;
n_3_1_1 -> n_3_1_0 ;
};
subgraph cluster2{
label="t=10"
n_3_2_0[label="192.168.8.6"
pos="14,10!"
];
n_3_2_1[label="192.168.8.3"
pos="10,10!"
];
n_3_2_2[label="192.168.8.9"
pos="15,11!"
];
n_3_2_3[label="192.168.8.8"
pos="18,12!"
];
n_3_2_0 -> n_3_2_1 ;
n_3_2_2 -> n_3_2_3 ;
n_3_2_1 -> n_3_2_0 ;
n_3_2_3 -> n_3_2_2 ;
};
}
我迫使節點位置編譯這段代碼 1.子圖不按t = 0,t-5,t = 10 ... 的順序顯示2.子圖不與左邊對齊。
我需要有輸出圖所示: http://imageshack.us/photo/my-images/253/needed.png/
Thnak你。
我需要的第一個圖,您已經如上圖所示。但我無法生成它。我用naeto編譯,我可以得到這樣的東西: http://imageshack.us/f/833/sourcedotgv.png/ – OSMuser
你正在使用什麼版本的graphviz?您可能需要更新 – marapet
我的graphviz版本是2.26.3。 我試圖安裝graphviz版本2.29,它需要libgraphviz4(> = 2.18)。我無法在ubuntu12.04中安裝libgraphviz4,它與'libcdt4' – OSMuser