Graphviz: <img/> not displayed in 'svg' output image

Viewed 1054

I am using Pygraphviz library with python 2.7. I'm generating 'svg' output images. What I like to do is to use an 'svg' image as the label of my graphs. To do that, I am using the html tag (http://www.graphviz.org/doc/info/shapes.html#html).

Here is the part of my code that is responsible to do that:

dot = Digraph(comment=zone)
dot.graph_attr['label'] = "\
<\
<TABLE>\
   <TR>\
      <TD><IMG SRC=\"/path/to/svg/image\"/></TD>
   </TR>
</TABLE>
>"

The svg output image is created but my svg logo is not displayed; the table is empty)

Any ideas?

1 Answers

I know this is a very old question, but as this is the first result on google and I stumbled over this as well I thought I'd share:

  • You can open the *.svg with a text editor to check that the links are there and point to the correct location xlink:href="/path/to/svg/image" (which was the case for me)
  • Make sure to open it with an application that actually loads the images (e.g. firefox, chrome, inkscape). The default image viewer in gnome, GIMP, Krita, etc. open the image just fine, but don't load the images by default, resulting in an empty table/node.
Related