如何以相同的间距生成img [英] how to generate img with same spacing

查看:78
本文介绍了如何以相同的间距生成img的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从此输出生成了一个图形:

I generated a graph from this output:

digraph G {
    { rank = same; 1; 2; 3; 4; 5; 6; 7; 8; 9; };
    2 -> 3 [label="hi there"];
}

但是标签很长,这导致节点2和3之间的间隔大于其他节点之间的间隔.如何使所有其他节点之间的间隔与2到3之间的间隔匹配(即它们中最大的一个).

However the label is long, which results in the space between nodes 2 and 3 being greater than the space between the other nodes. How can I make it so that the space between all other nodes matches the one between 2 and 3 (that is, the biggest of them all).

推荐答案

您可以使用xlabel代替标签,并使用nodesep增加相同等级的节点之间的间隔:

You could use xlabel instead of a label, and increase the separation between nodes of the same rank with nodesep:

在点中,这指定了两个相邻节点之间的最小间距 相同的等级,以英寸为单位.

In dot, this specifies the minimum space between two adjacent nodes in the same rank, in inches.

digraph G {
    nodesep=0.8;
    forcelabels=true;
    { rank = same; 1; 2; 3; 4; 5; 6; 7; 8; 9; };
    2 -> 3 [xlabel="hi there"];
}

这篇关于如何以相同的间距生成img的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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