Graphviz ---边缘标签距离另一条边缘太近 [英] Graphviz --- edge label too close to another edge

查看:66
本文介绍了Graphviz ---边缘标签距离另一条边缘太近的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下代码,结果如下图所示.如您所见,它在边缘和边缘标签周围有些拥挤,尤其是在"^ a"周围.最好创建一点点空间,以便可以清楚地看到哪个标签属于哪个边缘,这是最好的方法?

I have the following code, and it results in the image below. As you can see, it's a little crowded around the edges and edge labels, especially around the "^a". What is the best way to create just a tad more space, so that one can clearly see which label belongs to which edge?

digraph finite_state_machine {                                                                                                                                                                                  
    pad=0.2;
    {
        rank=same;
        node [shape = point, style = invis]; q_0;
        node [shape = doublecircle, style = solid]; q_5;
        node [shape = circle];
        q_1 [ label = <<i>q<sub>1</sub></i>> ];
        q_2 [ label = <<i>q<sub>2</sub></i>> ];
        q_3 [ label = <<i>q<sub>3</sub></i>> ];
        q_4 [ label = <<i>q<sub>4</sub></i>> ];
        q_5 [ label = <<i>q<sub>5</sub></i>> ];
        q_0 -> q_1;
        q_1 -> q_2 [ label = "." ];
        q_1 -> q_2 [ label = <&epsilon;>, constraint=false ];
        q_2 -> q_1 [ label = <&epsilon;>, constraint=false ];
        q_2 -> q_3 [ label = <<i>a</i>> ];
        q_3 -> q_4 [ label = <<i>^a</i>> ];
        q_3 -> q_4 [ label = <&epsilon;>, constraint=false ];
        q_4 -> q_3 [ label = <&epsilon;>, constraint=false ];
        q_4 -> q_5 [ label = <<i>b</i>> ];
    }
}

推荐答案

没有

There is no attribute in Graphviz to adjust the margin/padding around edge labels. The closest you can probably get to the effect you require is to use \n to introduce blank lines above/below your label to force space.

很明显,这不会自动扩展为任何内容.

Obviously, this will not scale to anything automatic.

或者,您可以尝试使用ranksep属性强制使用一些额外的空间.

Alternately, you could try to use the ranksep attribute to force in some additional space.

这篇关于Graphviz ---边缘标签距离另一条边缘太近的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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