【问题标题】:Distinct colors for headlabel and taillabel in graphvizgraphviz中headlabel和taillabel的不同颜色
【发布时间】:2013-07-15 20:34:14
【问题描述】:

是否可以在 graphviz 中为 headlabel 和 taillabel 设置不同的颜色? 使用 labelfontcolor 我可以为它们设置一种通用颜色,但我需要不同的颜色(例如 headfontcolor 和 tailfontcolor,但这些属性不存在)。

【问题讨论】:

    标签: graphviz dot


    【解决方案1】:

    您可以使用 graphviz 中的 HTML 样式标签成功完成此操作(您可以在此页面上找到大量信息:http://www.graphviz.org/doc/info/shapes.html),尤其是 font 之一:

    digraph test
    {
        A -> B
        [
            taillabel = <<font color="red">tail</font>>
            label     = <<font color="green">middle</font>>
            headlabel = <<font color="blue">head</font>>
        ]
    }
    

    此代码将生成以下图表:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-10-24
      • 2022-01-26
      • 2019-03-08
      • 1970-01-01
      • 1970-01-01
      • 2011-05-14
      • 1970-01-01
      相关资源
      最近更新 更多