0

Is it possible to use an svg image to create a custom node in Networkx? For example:

Using this svg image: https://upload.wikimedia.org/wikipedia/commons/6/67/Firefox_Logo%2C_2017.svg

And in peudocode:

nx.draw(G, pos=pos, node_shape=svg_string)

And end up with something like this:

enter image description here

How could this be done?

samuelbrody1249
  • 4,379
  • 1
  • 15
  • 58
  • Matplotlib does not support import of vector graphics so combining SVG files and matplotlib graphs is a pain (though strictly speaking possible via [svg-utils](https://github.com/btel/svg_utils). How important is using figures in SVG format to you? Would a rasterized format like a PNG file also work? – Paul Brodersen Feb 19 '20 at 10:38

1 Answers1

0
  1. Convert the Graph to Dot 1.
  2. Draw the node as an image. 2.
Unapiedra
  • 15,037
  • 12
  • 64
  • 93