【问题标题】:How to change the background color of a edge label in GraphViz如何在 GraphViz 中更改边缘标签的背景颜色
【发布时间】:2020-01-04 12:31:56
【问题描述】:

我想更改 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 中选择吗?

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

谢谢

【问题讨论】:

  • 试试 fillcolor = white
  • 感谢您的想法,不幸的是这不起作用。

标签: graphviz


【解决方案1】:

在 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"];

【讨论】:

  • 谢谢!令人难以置信的是,标签选项中没有集成这个基本功能......
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-08-20
  • 2010-10-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-22
相关资源
最近更新 更多