我正在使用graphviz twopi生成一个png文件。我有很多点文件但只有三个无法转换为png。以下是一个无法转换的简化示例:
digraph G{
overlap = false;
splines = true;
root = "a";
"a" [label ="ATCC 12633"];
"b" [label = "R M Egan",fontsize=25];
"a" -> "b" [label = "paper:1",penwidth = 4,color = black ,len=2];
"c" [fontsize=25, label = "ATCC 8014"];
"b" -> "c" [label = "paper:1"];
}
我使用-v查看详细信息,其中包括:
mongodb@mongodb:/home/wuchang/newStore/allYear$ sudo twopi ATCC_12633_1977.dot -Tpng -o 77.png -v
twopi - graphviz version 2.26.3 (20100126.1600)
Activated plugin library: libgvplugin_pango.so.6
Using textlayout: textlayout:cairo
Activated plugin library: libgvplugin_neato_layout.so.6
Using layout: twopi:neato_layout
Using render: cairo:cairo
Using device: png:cairo:cairo
The plugin configuration file:
/usr/lib/graphviz/config6
was successfully loaded.
render : cairo dot fig gd map ps svg tk vml vrml xdot
layout : circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi
textlayout : textlayout
device : canon cmap cmapx cmapx_np dot eps fig gd gd2 gif gv imap imap_np ismap jpe jpeg jpg pdf plain plain-ext png ps ps2 svg svgz tk vml vmlz vrml wbmp x11 xdot xlib
loadimage : (lib) eps gd gd2 gif jpe jpeg jpg png ps svg
fontname: "Times-Roman" resolved to: (ps:pango Times Roman,) (PangoCairoFcFont) "DejaVu Sans 14"
root = a
Rank separation = 0.000 1.000 2.000
Adjusting G using Voronoi
Node separation: add=1 (4.000000,4.000000)
我怀疑这只是graphviz中的一个错误。我的graphviz版本是2.26.3,我的操作系统是Ubuntu 12.04.3 LTS。
与转换输出为:
的成功转换的点文件相比mongodb@mongodb:/home/wuchang/newStore/allYear$ sudo twopi ATCC_12633_1988.dot -Tpng -o 88.png -v
twopi - graphviz version 2.26.3 (20100126.1600)
Activated plugin library: libgvplugin_pango.so.6
Using textlayout: textlayout:cairo
Activated plugin library: libgvplugin_neato_layout.so.6
Using layout: twopi:neato_layout
Using render: cairo:cairo
Using device: png:cairo:cairo
The plugin configuration file:
/usr/lib/graphviz/config6
was successfully loaded.
render : cairo dot fig gd map ps svg tk vml vrml xdot
layout : circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi
textlayout : textlayout
device : canon cmap cmapx cmapx_np dot eps fig gd gd2 gif gv imap imap_np ismap jpe jpeg jpg pdf plain plain-ext png ps ps2 svg svgz tk vml vmlz vrml wbmp x11 xdot xlib
loadimage : (lib) eps gd gd2 gif jpe jpeg jpg png ps svg
fontname: "Times New Roman Bold" resolved to: (PangoCairoFcFont) "DejaVu Sans Bold 30"
fontname: "Times-Roman" resolved to: (ps:pango Times Roman,) (PangoCairoFcFont) "DejaVu Sans 24.9990234375"
root = -290487096
Rank separation = 0.000 1.000 2.000
Adjusting G using Voronoi
Node separation: add=1 (4.000000,4.000000)
Number of iterations = 5
Number of increases = 3
Edge separation: add=1 (3.200000,3.200000)
Creating edges using splines
Using render: cairo:cairo
Using device: png:cairo:cairo
twopi: allocating a 1477K cairo image surface (907 x 417 pixels)
我尝试了很多修改,例如:
overlap=false
,它可以生成png文件但是
生成的图形节点重叠,不符合我的要求
需求。 fontsize = 23
时,它也是
可以生成png文件,但是png文件是完全的
错。答案 0 :(得分:0)
我建议您更新到更新版本的Graphviz。过去四年里有很多发展。因为您的详细输出在显示迭代次数之前结束,所以我强烈怀疑它是您正在使用的Graphviz版本的错误(可能是无限循环)。
在OS X下使用2.36.0,你的文件给了我这个(显然不是你想要的):
如果我注释掉root = "a";
行,我就明白了: