【问题标题】:How can I use \" in a label in GraphViz using Dot?如何使用 Dot 在 GraphViz 的标签中使用 \"?
【发布时间】:2015-12-16 01:04:59
【问题描述】:

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

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

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

我试过用 \", \\" 替换 \", 问题是 GraphViz 将 \" 解释为 ";无论如何。

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

【问题讨论】:

    标签: linux unix graphviz dot


    【解决方案1】:
    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;
    }
    

    【讨论】:

      猜你喜欢
      • 2012-09-05
      • 2019-09-11
      • 2011-01-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-21
      • 2021-09-28
      相关资源
      最近更新 更多