Graphviz:将边缘标签放在另一侧
这可能与 如何在 graphviz 中将边标签放置在边上有关:我有以下图表,我使用命令 dot -Teps g.dot > 进行可视化g.eps:
graph triple {
node [shape=box]; User; Object; Tag;
node [shape=diamond,style=filled]; Triple;
{
User -- Triple [label = "1"];
Object -- Triple [label = "1"];
}
{
rank=same;
User;
Object;
}
Triple -- Tag [label="n"];
}
我希望通过将标签放在图表左侧的 User 和 Triple 之间,使结果更加对称。
This may be related to How to place edge labels ON edge in graphviz: I have the following graph, which I visualize using the command dot -Teps g.dot > g.eps
:
graph triple {
node [shape=box]; User; Object; Tag;
node [shape=diamond,style=filled]; Triple;
{
User -- Triple [label = "1"];
Object -- Triple [label = "1"];
}
{
rank=same;
User;
Object;
}
Triple -- Tag [label="n"];
}
I would like the result to be more symmetric by putting the label between User and Triple on the left side of the graph.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
graphviz 无法手动放置边缘标签。
但是,您可以使用
headlabel
、labeldistance
和labelangle
属性:输出:
Manual placement of edge labels cannot be done with graphviz.
However, you could use the
headlabel
,labeldistance
andlabelangle
attributes:Output:
这是使用
splines=false
和双边的第二个解决方法:输出:
And here's the second workaround using
splines=false
and double edges:Output:
我放弃了让它在 Graphviz 中工作的尝试。相反,我渲染为 pdf,自己标记 pdf 以添加标签,然后将 pdf 拼合为新 pdf,这样标记将成为 pdf 的一部分。
I gave up trying to get it to work in Graphviz. Instead, I rendered as a pdf, marked up the pdf to add labels myself, and then flattened the pdf into a new pdf so the markups would be part of the pdf.