Search code examples
graphviz

Graphviz: Distinct colors for xlabel and nodelabel


Is it possible to have distinct font colors for xlabel and node label in Graphviz?

digraph {
    "complete" [xlabel="complete", label="complete", fontcolor=red];
}

Solution

  • Only way I know of is a bit of a kludge. Use html labels for the label or xlabel:

    digraph {
        "complete" [xlabel=<<font color="green">Xcomplete</font>>
            label="complete", fontcolor=red];
    }
    

    produces this: enter image description here