如何使用Dot在GraphViz中的标签中使用?

时间:2015-12-15 16:29:26

标签: linux unix graphviz dot

我正在使用dot-graphviz版本2.26.3(20100126.1600)

我希望有一个带有以下标签的节点(包括\):

文字在这里\“\”更多文字

我试过更换\“with \”,\\“, 问题是GraphViz解释为“as”;无论如何。

如何在标签中输出\“\”?

1 个答案:

答案 0 :(得分:6)

digraph Quote{
node [shape="record", style="rounded"];
edge [style="dashed"];

Explain [label="<0>\\| <1>\\| <2>\\| <3>\"|<res> result"];
n0 [label="backslash to escape next backslash"];
n1 [label="backslash"];
n2 [label="backslash to escape next quote"];
n3 [label="quote"];
n4 [label="\\\""];

Explain:0 -> n0;
Explain:1 -> n1;
Explain:2 -> n2;
Explain:3 -> n3;
Explain:res -> n4;
}

enter image description here