Display a .png in a node

42 views
Skip to first unread message

alexandr...@ekla.fr

unread,
Dec 14, 2016, 10:38:13 AM12/14/16
to pygraphviz-discuss
Hi all, 
I want to display a .png in a node like a label. It is easy to do with the digraph langage but i want to do it in pygraphviz.
Thanks for help

Aric Hagberg

unread,
Dec 14, 2016, 4:34:50 PM12/14/16
to pygraphvi...@googlegroups.com
Something like this should work. The file image.png is the node image.

from pygraphviz import AGraph
A = AGraph()
A.add_node("a",image='image.png',label='',shape='none')
A.layout()
print(A)
A.draw('output.png')

--
You received this message because you are subscribed to the Google Groups "pygraphviz-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pygraphviz-disc...@googlegroups.com.
To post to this group, send email to pygraphvi...@googlegroups.com.
Visit this group at https://groups.google.com/group/pygraphviz-discuss.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages