增加子图之间的距离

Th3*_*B0Y 7 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"  ];
}
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

我想增加子图之间的距离.我已经尝试使用len,margin,pad,但我一直在尝试,语法不起作用.有人能帮助我吗?

Pot*_*rca 13

我认为你正在寻找的东西(正如Emden指出的那样)确实是nodesepranksep属性.

graph [nodesep=6, ranksep=4];
Run Code Online (Sandbox Code Playgroud)

结果将是:

在此输入图像描述

  • 这是迟到的评论。但我有一个疑问。添加nodesep和rankep将解决上述解决方案。这是一个很好的建议。但是,图形的其他部分也会扩展。我只想增加两个集群之间的距离。休息一切都应该保持不变。甚至有可能吗? (2认同)