bordergraphvizsubgraph

Graphviz not drawing border around subgraph


Consider the following Graphviz code:

digraph g1 { 
    compound = true;
    node [shape = box, style=filled, fillcolor=Khaki] a;

    subgraph sg1 {
        node [shape = "", style="", fillcolor=""] b -> c;
        graph [style=solid, penwidth=3];
    }
}

this yields:

enter image description here

Why am I not getting a border around the subgraph/cluster?


Solution

  • sg1 must be a cluster to have the border drawn

    ie. rename it to eg. cluster_sg1

    [edit]

    Or Add line: cluster=true inside subgraph see documentation here: https://graphviz.org/docs/attrs/cluster/