我正在尝试让 graphviz 正常工作,我迫切需要节点标签中的下标。不幸的是,通过与人们讨论类似问题的无休止的帖子,似乎我适合所有提出的解决方案,但仍然无法正常工作。这是我的代码:
digraph G{
execute [label=<ex<SUB>2</SUB>>];
main -> parse -> execute;
main -> init;
main -> cleanup;
init -> make_string;
main -> printf;
}
也运行这个:
$ dot -Tps:cairo -v test.gv -o out.ps
并作为输出:
> dot - graphviz version 2.26.3 (20100126.1600)
Activated plugin library: libgvplugin_pango.so.6
Using textlayout: textlayout:cairo
Activated plugin library: libgvplugin_dot_layout.so.6
Using layout: dot:dot_layout
Using render: cairo:cairo
Using device: ps: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
Error: Unknown HTML element <SUB> on line 1
fontname: "Times-Roman" resolved to: (ps:pango Times Roman,) (PangoCairoFcFont) "DejaVu Sans 14"
in label of node execute
network simplex: 7 nodes 6 edges maxiter=2147483647 balance=1
network simplex: 7 nodes 6 edges 0 iter 0.00 sec
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross G: 0 crossings, 0.00 secs.
network simplex: 13 nodes 16 edges maxiter=2147483647 balance=2
network simplex: 13 nodes 16 edges 1 iter 0.00 sec
routesplines: 6 edges, 18 boxes 0.00 sec
Using render: cairo:cairo
Using device: ps:cairo:cairo
我对 cairo 或 svg 渲染不太熟悉,我很不确定这是与 graphviz 一起打包的还是它是一个单独的库。我有 Ubuntu 12,通过 apt-get 安装了 graphviz。任何帮助将不胜感激。
谢谢