Is it possible to draw graphs on a given image using NetworkX?
Question: Is it possible to draw graphs on a given image (instead of on an empty figure)
by using the python package NetworkX?


Answer: Perhaps you can try this but it requires matplotlib:

    
    
    import matplotlib.pyplot as plt
    import matplotlib.image as mpimg
    import networkx as nx
    G = nx.cycle_graph(2)
    pos =   {0:[0,0], 1:[ 300,  300]}
    plt.figure(1)
    img=mpimg.imread('/home/stinkbug.png')
    plt.imshow(img)
    nx.draw(G,pos)
    plt.savefig('/home/test.png')
    

I used the stink bug on this
[page](http://matplotlib.sourceforge.net/users/image_tutorial.html).

Using networkx by itself might be a little tricky. Perhaps you could set the
image you want as a node (say node 0) and then position the node at origin
(0,0). Finally, orient the other nodes from your graph on top of them. I
haven't tried it myself but its an idea that popped into my head.

