【问题标题】:Graphviz---how do I make edges not cross each other; choose self-loop edge positionGraphviz---我如何使边缘不相互交叉;选择自环边缘位置
【发布时间】:2020-02-15 21:06:56
【问题描述】:

我有以下点文件:

digraph finite_state_machine {                                                                                                                                                                                  
    pad=0.2;
    {
        rank=same;
        node [shape = doublecircle]; q_3;
        node [shape = circle];
        q_1 [ label = <<b><i>q<sub>1</sub></i></b>> ];
        q_2 [ label = <<b><i>q<sub>2</sub></i></b>> ];
        q_3 [ label = <<b><i>q<sub>3</sub></i></b>> ];
        q_1 -> q_1 [ label = <<b><i>^a</i></b>> ];
        q_1 -> q_2 [ label = <<b><i>a</i></b>> ];
        q_2 -> q_2 [ label = <<b><i>^b</i></b>> ];
        q_2 -> q_3 [ label = <<b><i>b</i></b>> ];
    }
}

我得到以下输出:

我希望自循环位于节点之上,而不是越过其他边缘。并且,如果可能的话,更多的循环。我怎样才能做到这一点?

我希望它看起来像这样:

【问题讨论】:

    标签: graphviz


    【解决方案1】:

    您可以使用ports/compass points:

    q_1:e -> q_1:w [ label = <<b><i>^a</i></b>> ];
    q_2:e -> q_2:w [ label = <<b><i>^b</i></b>> ];
    

    或使用nw/ne 作为罗盘点:

    【讨论】:

    • 感谢您的努力,但我不喜欢结果。编辑我的帖子以包含我想要的图片。或者也许我可以使用 ne 和 nw 作为方向/点。我明天试试。
    • 当然你可以用nw/ne作为罗盘点,我加了一个修改的例子
    猜你喜欢
    • 2011-04-27
    • 2012-08-13
    • 1970-01-01
    • 2020-11-12
    • 2010-12-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多