How to use "Brewer color schemes" on nodes in graph?

Hey everyone,

I have been manually setting color to nodes in simple graph. Then recently I learnt about the Brewer color schemes which looks awesome. But unfortunately I am unable to find the correct syntax to use it :frowning:

Can someone please help me with an Example on how to use Brewer color schemes colors?

Apologies, some digging into documentation helped me how to use colorschemes

https://www.graphviz.org/doc/info/attrs.html#d:colorscheme

Have a great day people :slight_smile:

graph test123 {
    graph [fontsize=24];
    edge [fontsize=24];
    node [fontsize=24, colorscheme=spectral9];

    x [color=lightblue,style=filled];
    y [color=lightgreen,style=filled];
    a [label = "A", color=3,style=filled];
    d [fillcolor=yellow,style="rounded,filled", shape=diamond]
    a -- b -- c;
    a -- {x y};
    x -- c [w=10.0];
    x -- y [w=5.0,len=3];
    edge [style="setlinewidth(3)", color=red];
    edge [len=3];
    a -- { b c d };
}

1 Like

Good. I assume you found
https://graphviz.gitlab.io/_pages/doc/info/colors.html

I was working on a response for you and trying to produce a concise example, but ran into a different bug. I was trying to do this:

graph {
node [style=filled colorscheme=bugn3 color="\N"]
1–2--3
}

But apparently the β€œ\N” substitution isn’t accepted by the color name parser …