11

我有以下代码:

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"  ];
}

在此处输入图像描述

我想增加子图之间的距离。我试过使用len, margin, pad,但我试过的语法不起作用。有人可以帮助我吗?

4

2 回答 2

16

我认为您正在寻找的(正如Emden指出的那样)确实是nodeeprankep属性。

graph [nodesep=6, ranksep=4];

结果将是:

在此处输入图像描述

于 2013-11-02T10:50:34.337 回答
4

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

于 2013-10-22T13:34:50.647 回答