Graphviz:将图表与其标签对齐
默认情况下,Graphviz 将图形相对于其标题(标签)居中:
graph {
label="lorem ipsum dolor sit amet consectetur adipiscing elit"
A -- B
}
如何将图形左对齐,即使A、B和“lorem”的首字母垂直对齐? 属性 labeljust
和 labelloc
有其他用途,我在 参考 来实现此结果。
By default, Graphviz centers the graph relatively to its caption (label):
graph {
label="lorem ipsum dolor sit amet consectetur adipiscing elit"
A -- B
}
How can I align the graph to the left, i.e., make A, B and the initial of "lorem" vertically aligned?
The attributes labeljust
and labelloc
have other purposes, and I cannot see anything in the reference to achieve this result.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
(它有助于将您的源代码包含为文本,而不是 png)
没有直接的方法,但是(如果需要)使用不可见节点和/或节点宽度来使图形足够宽以满足您的需求。然后使用 labeljust 属性将标签对齐到整个图表的左侧(或右侧)。
给予:

(it helps it include your source as text, not png)
No direct way, but (if needed) use invisible nodes and/or node width to get the graph wide enough to meet your needs. Then use the labeljust attribute to to justify the label to the left (or right) of the entire graph.
giving:
