更改Graphviz中节点的标签方向 [英] Change label orientation 90º of a node in Graphviz

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

问题描述

有什么方法可以将文本的方向更改为90°吗?

示例:

初始图形:

所需图形:

我的代码:

digraph G {
  layout="neato"
  edge[arrowhead=none]
  node[style=filled fillcolor="white", fixedsize=true]
  circunferencia[label="", pos="0.0, 0.0!", shape = "circle", width=2, color="grey", style=boldsi];
  1[label="1()", pos="0.30901699437494745,0.9510565162951535!", shape = "circle"];
  5[label="5()", pos="-0.8090169943749473,0.5877852522924732!", shape = "circle"];
  4[label="4()", pos="-0.8090169943749476,-0.587785252292473!", shape = "circle"];
  3[label="3()", pos="0.30901699437494723,-0.9510565162951536!", shape = "circle"];
  2[label="2()", pos="1.0,-2.4492935982947064e-16!", shape = "circle"];
  centro[label="", pos="0.0, 0.0!", shape = "point", fillcolor=black];
}

推荐答案

无法在Graphviz中以本机方式旋转标签。

您的选项可能是:

1.以图像形式提供标签。在这种情况下,您可以在图形编辑器中随意旋转它们:

digraph {
    a [
        image="one.png"
        label=""
    ]
    b [
        image="two.png"
        label=""
    ]
    a -> b [label=<<TABLE border="0">
    <TR><TD><IMG SRC="rot.png"/></TD></TR>
    </TABLE>>];
}

结果:

2.如果您需要旋转整个图形中的标签,可以尝试绘制初始旋转的图形,然后旋转整个图像,例如rotate图形属性:

digraph {
    rotate=90
    a [
        label="One"
    ]
    b [
        label="Two"
    ]
    a -> b [label="label"];
}

结果:

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

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