用图像注释DOT图 [英] Annotate DOT graphs with images

查看:119
本文介绍了用图像注释DOT图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用PyDot在python中生成Graphviz/dot图.我想用从文件中读取的图像来注释节点和边缘,我在文档中发现了如何将图像作为节点放置,而不是如何将图像放置在节点甚至边缘以下.

I'm using PyDot to generate Graphviz/dot graphs in python. I would like to annotate my nodes and edges with images read from files, I've found in the documentation how to put an image as a node, but not how to put an image under a node or even less an edge.

http://www.graphviz.org/doc/info/attrs.html

http://www.graphviz.org/doc/info/shapes.html

http://www.graphviz.org/Documentation/html/shapehowto.html

有人知道怎么做吗?

推荐答案

您可以在节点和边的标签中使用HTML.您可以在此处找到详细信息: http://www.graphviz.org/doc/info /shapes.html#html

You can use HTML in the labels for nodes and edges. You can find details here: http://www.graphviz.org/doc/info/shapes.html#html

基本上你可以说些什么

"a" -> "b" [label = <<TABLE><TR><TD><IMG SRC="path/to/picture"/></TD></TR></Table>>]

您可以在html标签中添加任意数量的行和列.它比标准文本标签更详细,但是您可以使用它们做更多的事情.

You can add as many rows and columns as you want in the html labels. It's a little more verbose than standard text labels, but you can do a bit more with them.

这篇关于用图像注释DOT图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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