Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increasing distance between subgraphs

Tags:

graph

graphviz

I have the following code:

digraph g {
graph [rankdir="LR" ,compound="true" ];
    subgraph cluster0 {
        graph [label="Ready\n\nAllowed Purchaser Operations:\noperation1,operation2\n\nAllowed Supplier Operations:\noperation1,operation3"  ];
        1 [ shape="none" ,fontcolor="white"  ];
    };
    subgraph cluster2 {
        graph [label="Paused\n\nAllowed Purchaser Operations:\noperation1,operation3\n\nAllowed Supplier Operations:\noperation2,operation3" ];
        3 [ shape="none" ,fontcolor="white"  ];
    };
    subgraph cluster4 {
        graph [label="Completed\n\nAllowed Purchaser Operations:\noperation4\n\nAllowed Supplier Operations:\noperation4" ];
        5 [ shape="none" ,fontcolor="white"  ];
    };
    1 -> 3 [ ltail="cluster0" ,lhead="cluster2" ,comment="6"  ];
    1 -> 5 [ ltail="cluster0" ,lhead="cluster4" ,comment="7"  ];
    3 -> 1 [ ltail="cluster2" ,lhead="cluster0" ,comment="8"  ];
    3 -> 5 [ ltail="cluster2" ,lhead="cluster4" ,comment="9"  ];
}

enter image description here

I want to increase the distance between the subgraphs. I've tried using len, margin, pad, but the syntax I've tried doesn't work. Can somebody help me?

like image 227
Th3B0Y Avatar asked Oct 22 '13 12:10

Th3B0Y


1 Answers

I think what you are looking for (as Emden points out) are indeed the nodesep and ranksep attributes.

graph [nodesep=6, ranksep=4];

The result would be:

enter image description here

like image 175
Potherca Avatar answered Oct 01 '22 06:10

Potherca