如何在GraphViz中更改边标签的背景颜色

8

我希望更改Graphviz中边缘标签的背景颜色。目前,我唯一能想到的方法是使用HTML表格。

例如:

edge [len=3,fontcolor=red];
DeviceA -- DeviceB [headlabel=<
    <table border="0" cellborder="0">
        <tr>
            <td bgcolor="white">Head Label</td>
        </tr>
    </table>>
,taillabel="Tail Label"];

我希望能做到更加简洁明了的操作方式:

以下是需要翻译的内容:

edge [len=3,fontcolor=red,bgcolour=white];
DeviceA -- DeviceB [headlabel="Head Label",taillabel="Tail Label"];

在graphviz中有这个选项吗?

我之所以尝试这样做,是因为末尾标签最终会写在边缘上,这使得标签难以阅读。与画布相同颜色的背景色可以人为地在边缘上创建一个断点。

谢谢。


尝试填充颜色为白色。 - Nitin Dhomse
1
谢谢你的想法,不幸的是那行不通。 - Rowan Smith
1个回答

7
在GraphViz中,没有改变边标签背景颜色的方式。但是,您可以通过使用HTML表格来实现相同的效果:
例如:
edge [len=3,fontcolor=red];
DeviceA -- DeviceB [headlabel=<
    <table border="0" cellborder="0">
        <tr>
            <td bgcolor="white">Head Label</td>
        </tr>
    </table>>
,taillabel="Tail Label"];

谢谢!令人难以置信的是,在标签选项中没有集成这种基本功能... - Tropilio

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接