问题
Following is code using dot language.
subgraph cluster1
{
node[style=filled];
color=blue;
b0->b1;
label ="Tada"; // I want this to show as underlined.
}
回答1:
You can use HTML-like labels and the <u>
tag:
digraph cluster1
{
node[style=filled, color=blue];
b0->b1;
label = <<u>Tada</u>>; // I want this to show as underlined.
}
This is the result:
Note that your color=blue
statement wasn't applied to any element. I moved it into node
.
As pointed out in the comments, this currently only works for svg output. I tried with png and pdf on my Mac running 10.14.6 and they weren't underlined.
来源:https://stackoverflow.com/questions/22456268/how-to-underline-text-as-part-of-a-label