Search code examples
graphvizdot

Adding color gradient in graphviz edges


From the example given here, I can change edge width using weight/penwidth.

I can add color using color.

Now, how to put gradient? Is this even possible for an edge?


Solution

  • Seemingly not. If you read here: https://graphviz.org/docs/attr-types/colorList/ and here: https://graphviz.org/docs/attrs/color/, you will find that gradients are possible, but not for edges. Instead of a gradient, you get parallel colored lines.

    For edges, the value can either be a single color or a colorList.

    In the latter case, if colorList has no fractions, the edge is drawn using parallel splines or lines, one for each color in the list, in the order given.