gpt4 book ai didi

graphviz - 用点进行文本换行 (graphviz)

转载 作者:行者123 更新时间:2023-12-02 21:22:38 27 4
gpt4 key购买 nike

我使用下面的代码使用点(graphviz)创建了一个图形。

digraph
{
node [color=Blue,shape=box]

1.1 [label="Frequency of t exceeds upper threshold"]
2.1 [label="t has d-mutant tiles"]
2.2 [label="Valid"]
3.1 [label="Frequency of t exceeds lower threshold"]
3.2 [label="Frequency of t exceeds lower threshold"]
4.1 [label="Insufficient evidence"]
4.2 [label="Valid"]
4.3 [label="t has only one d-mutant that exceeds lower threshold"]
4.4 [label="Are there any d-mutant tiles with significantly higher frequencies?"]
5.1 [label="Insufficient evidence"]
node [color=Green] 5.2 [label="Correct t to t'"] node [color=Blue]
5.3 [label="t has a d-mutant tile t' that is closer than all other d-mutant tiles and for which a corrected base has a higher quality score"]
5.4 [label="Valid"]
6.1 [label="Insufficient evidence"]
6.2 [label="t' is unique"]
7.1 [label="Insufficient evidence"]
node [color=Green] 7.2 [label="Correct t to t'"] node [color=Blue]

1.1 -> 2.1 [label="no"]
1.1 -> 2.2 [label="yes"]
2.1 -> 3.1 [label="no"]
2.1 -> 3.2 [label="yes"]
3.1 -> 4.1 [label="no"]
3.1 -> 4.2 [label="yes"]
3.2 -> 4.3 [label="no"]
3.2 -> 4.4 [label="yes"]
4.3 -> 5.1 [label="no"]
4.3 -> 5.2 [label="yes"]
4.4 -> 5.3 [label="no"]
4.4 -> 5.4 [label="yes"]
5.3 -> 6.1 [label="no"]
5.3 -> 6.2 [label="yes"]
6.2 -> 7.1 [label="no"]
6.2 -> 7.2 [label="yes"]
}

正如您所看到的,图形中的一些框的标签中有很多文本。我可以插入 \n 字符来确保框不太宽,但我想知道是否有一种方法可以设置框的宽度,然后让框标签执行硬包装。这可能吗?

最佳答案

graphviz 不支持自动换行。您必须手动输入\n。

您可以设置节点的宽度和高度并将其定义为固定大小 - 这将限制节点的大小并仅绘制适合节点的文本

关于graphviz - 用点进行文本换行 (graphviz),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5277864/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com