gpt4 book ai didi

graphviz - 节点的 xlabels 与点中的边重叠

转载 作者:行者123 更新时间:2023-12-04 12:21:34 26 4
gpt4 key购买 nike

我尝试使用 dot 绘制图形,但出现以下问题

graph

节点标签 ba 的边缘重叠至 b .有没有办法以某种方式移动这个标签来避免这种情况?

这是我用来生成图像的代码(使用 dot )

digraph A {
rankdir=LR;
center=true; margin=0.3;
nodesep=1.5; ranksep=0.5;

node [shape=point, height=".2", width=".2"];

a [xlabel="a"];
b [xlabel="b"];
c [xlabel="c"];
a -> b -> c;
a -> c;
}

这种情况经常发生并且很烦人(此处相同,但有边缘):

enter image description here

我知道这是由 xlabel 造成的。 s 是在所有东西都布置好之后放置的,但我想知道是否可以帮助它一点 - 即说它需要放置标签的位置。

最佳答案

你不能这样做——你想为 xlabel 提供位置信息,但 graphviz 目前 (2016-01-25) 不允许这样做。有一个open feature request在graphviz错误跟踪器中用于此功能;它被描述为:

this is basically a feature request for allowing the user to provide position information for xlabels. For xlabels attached to nodes, the coordinates should be relative to the node position. A similar feature could hold for head and tail labels for edges. I suppose xlabels for edges could be based on the "center" of the edge.

关于graphviz - 节点的 xlabels 与点中的边重叠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20910932/

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