改变点的边缘方向 [英] Changing edge direction in dot

查看:77
本文介绍了改变点的边缘方向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在点图中绘制一个非常简单的图.

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

我得到的结果是

我确实必须从S -> S更改边缘,但是我还想更改箭头的方向,以便它们从左到右循环.

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.

推荐答案

要更改任何箭头的方向,您可以简单地使用dir=back:

To change the orientation of any arrow, you may simply use dir=back:

S -> S [dir=back];

但是在您的情况下,这似乎没有必要...(请参阅下文)

But in your case this doesn't seem to be necessary... (see below)

由于边缘S -> SA -> SS -> A边缘之间存在重叠,我建议仅在S和A之间使用一条边缘,两端都带有箭头:

Because of the overlap between the edge S -> S and the A -> S and S -> A edges, I suggest to use only one edge between S and A with an arrowhead on both ends:

digraph g {
    rankdir = LR;
    {rank=same; S; A}
    B -> A -> T;
    B -> S -> T;
    A -> A;
    S -> S;
    A -> S[dir=both];
}

这篇关于改变点的边缘方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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