增加子图之间的距离 [英] Increasing distance between subgraphs

查看:181
本文介绍了增加子图之间的距离的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  digraph g {
图形[rankdir =LR,compound = 真];
子图集群0 {
graph [label =Ready \\\
\\\
Allowed采购员操作:\ noperation1,operation2\\\
\\\
Allowed供应商操作:\ noperation1,operation3];
1 [shape =none,fontcolor =white];
};
subgraph cluster2 {
graph [label =Paused \\\
\\\
Allowed Purchaser Operations:\\\
operation1,operation3\\\
\\\
Allowed Supplier Operations:\\\
operation2,operation3];
3 [shape =none,fontcolor =white];
};
subgraph cluster4 {
graph [label =Completed \\\
\\\
Allowed Purchaser Operations:\\\
operation4\\\
\\\
Allowed Supplier Operations:\\\
operation4];
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 ,但我尝试过的语法不起作用。有人能帮助我吗?

解决方案

我想你在找什么(如 Emden 指出)确实是 nodesep ranksep 属性。

  graph [nodesep = 6,ranksep = 4]; 

结果如下:

< img src =https://i.stack.imgur.com/BDaV6.jpgalt =在这里输入图片描述>


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

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?

解决方案

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:

这篇关于增加子图之间的距离的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆