改变点的边缘方向
我正在尝试用点画一个非常简单的图表。
digraph untitled
{
rankdir = LR;
{rank=same; S; A}
B -> A;
B -> S;
A -> A;
S -> S;
A -> S ;
S -> A;
A -> T;
S -> T;
}
我得到的结果是
我真的必须从 S -> 更改边缘S
,但我还想更改箭头的方向,以便它们从左到右循环。
I'm trying to draw a pretty simple diagram in dot.
digraph untitled
{
rankdir = LR;
{rank=same; S; A}
B -> A;
B -> S;
A -> A;
S -> S;
A -> S ;
S -> A;
A -> T;
S -> T;
}
The results I get is
I really have to change the edge from S -> S
, but I would also like to change the orientation of the arrows so they loop from left to right.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要更改任何箭头的方向,您可以简单地使用
dir=back
:但在您的情况下,这似乎没有必要......(见下文)
由于边缘 < 之间的重叠代码>S-> S 和
A -> S
和S -> A
边,我建议仅使用 S 和 A 之间的一条边,两端都有箭头:To change the orientation of any arrow, you may simply use
dir=back
:But in your case this doesn't seem to be necessary... (see below)
Because of the overlap between the edge
S -> S
and theA -> S
andS -> A
edges, I suggest to use only one edge between S and A with an arrowhead on both ends:我不知道是否可以使箭头从左向右循环。您可以通过使用 dir 选项对箭头进行一定程度的控制,例如
此外,您可以通过将链接的长度从 S 更改为 S 来影响布局。您还可以控制(非自引用)的方向通过反转节点列出的顺序来改变箭头,例如:
我发现它几乎总是产生更好的图表,它受到的约束越少。我建议尝试删除rank=same 命令。
I don't know if it is possible to make the arrows loop from left to right. You can exercise a degree of control on the arrows by the use of the dir option eg
In addition you can influence the layout by changing the length of the link from S to S. You can also control the directions of (non-self referential) arrows by reversing the order the nodes are listed eg:
I have found that it nearly always produces better diagrams, the less it is constrained. I would suggest experimenting with removing the rank=same command.