增加子图之间的距离

时间:2013-10-22 12:50:52

标签: graph graphviz

我有以下代码:

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

我想增加子图之间的距离。我已尝试使用lenmarginpad,但我尝试过的语法不起作用。有人能帮助我吗?

2 个答案:

答案 0 :(得分:12)

我认为您正在寻找的内容(Emden指出)确实是nodesepranksep属性。

graph [nodesep=6, ranksep=4];

结果将是:

enter image description here

答案 1 :(得分:4)

集群是派生对象;它们的布局完全取决于它们中包含的节点。因此,要更改簇间距,您需要更改节点间距。尝试将ranksep和nodesep属性设置为更大的值。