Once you have built a graph using networkx, you can plot it using matplotlib or any other visualization library. To make it interactive and allow dragging of nodes, you can use the pyplot
library from Matplotlib and the draw_networkx
function from NetworkX.
Here's an example:
main.py388 chars22 lines
This will create a spring layout of the graph and plot it using draw_networkx
. It will then make the plot interactive and allow you to drag the nodes around.
gistlibby LogSnag