【发布时间】:2013-07-15 20:34:14
【问题描述】:
是否可以在 graphviz 中为 headlabel 和 taillabel 设置不同的颜色? 使用 labelfontcolor 我可以为它们设置一种通用颜色,但我需要不同的颜色(例如 headfontcolor 和 tailfontcolor,但这些属性不存在)。
【问题讨论】:
是否可以在 graphviz 中为 headlabel 和 taillabel 设置不同的颜色? 使用 labelfontcolor 我可以为它们设置一种通用颜色,但我需要不同的颜色(例如 headfontcolor 和 tailfontcolor,但这些属性不存在)。
【问题讨论】:
您可以使用 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>>
]
}
此代码将生成以下图表:
【讨论】: