Hello,
I'm using graph_tool in a scenario, in which the meaning of a vertex cannot be easily be explained by a label or a text. To get a meaningful graph I would need to display a image inside the vertices. Has anyone an idea, how could this be achieved?
Thanks
Soraltan
On 10.09.2015 17:01, Nils Hachmeister wrote:
I'm using graph_tool in a scenario, in which the meaning of a vertex cannot be easily be explained by a label or a text. To get a meaningful graph I would need to display a image inside the vertices. Has anyone an idea, how could this be achieved?
Just use the "vertex_surface" option in graph_draw(). It should be either a cairo surface, or the file name of an image.
See here for a concrete example:
https://graph-tool.skewed.de/static/doc/_downloads/animation_zombies.py
Best, Tiago
Cool, that solved it! Thanks!
Tiago de Paula Peixoto tiago@skewed.de hat am 10. September 2015 um 22:44 geschrieben:
On 10.09.2015 17:01, Nils Hachmeister wrote:
I'm using graph_tool in a scenario, in which the meaning of a vertex cannot be easily be explained by a label or a text. To get a meaningful graph I would need to display a image inside the vertices. Has anyone an idea, how could this be achieved?
Just use the "vertex_surface" option in graph_draw(). It should be either a cairo surface, or the file name of an image.
See here for a concrete example:
https://graph-tool.skewed.de/static/doc/_downloads/animation_zombies.py
Best, Tiago
-- Tiago de Paula Peixoto tiago@skewed.de
graph-tool mailing list graph-tool@skewed.de http://lists.skewed.de/mailman/listinfo/graph-tool
Hi Tiago,
I set "vertex_surface" propertymap when visualizing the graph, but in addition to the Image I load, the circle shape is also shown as the background of a vertex. What was I wrong? Thanks.
-- View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/... Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.