Search code examples
graphviz

How to specify weight to colors in stripped style in Graphviz?


In the Graphviz's documentation, it is said about the striped style that:

Optional color weights can be specified to indicate the proportional widths of the bars.

But there is not any other detail about this feature. How do you specify it ?


Solution

  • See the first couple of sentences in the "colorlist" documentation https://graphviz.org/docs/attr-types/colorList/
    An example:

    digraph{
      node[shape=rect]
      subgraph clusterX{
      graph [style="striped" color="purple" fillcolor="aqua;.7:pink"]
      a [style="striped" color="red" fillcolor="green;.2:blue;.2:yellow"]
      b [style="striped" color="green" fillcolor="green;.8:blue;.1:yellow"]
      b -> a [color="red;.5:blue;.2:orange"]
      }
    }
    

    enter image description here