0

I am trying to create network evolution animations. I know in R networkDynamic + NDTV packages can do this (https://kateto.net/network-visualization), and am trying to find the similar packages in Python since R studio memory is limited. I found PyNetX in Python is very similar with networkDynamic, but there’s barely no examples of using PyNetX because it’s new, and I didn’t find any packages in Python can perform NDTV package’s function. Is there any other ideas on creating the network visualization growing/changing over time (it doesn’t need to be dynamic, just want to make it move over time)?

Also, I found this answer might be helpful: Animating Network Growth with NetworkX and Matplotlib, but I got an error “unhashable type: 'dict'”. Do you know how to fix this? Thanks in advance!

  • I just added a [more current version](https://stackoverflow.com/a/62095199/12046409) of the code at the referenced post. Note that networkx's plotting isn't the most flashy one. Often people are referred to [graphviz](https://www.graphviz.org/) for visualizations, although that means having to deal with external software. – JohanC May 29 '20 at 22:01
  • Thank you JohanC. I tried it in Jupyter notebook, but it is a static graph and shows "C:\ProgramData\Anaconda3\lib\site-packages\networkx\drawing\nx_pylab.py:611: MatplotlibDeprecationWarning: isinstance(..., numbers.Number) if cb.is_numlike(alpha):". – Grace Z. Jun 01 '20 at 20:28
  • You might need to add `%matplotlib notebook` as a line in your notebook to have an interactive matplotlib graph. See e.g. [how-can-i-open-the-interactive-matplotlib-window-in-ipython-notebook](https://stackoverflow.com/questions/14261903/how-can-i-open-the-interactive-matplotlib-window-in-ipython-notebook) – JohanC Jun 01 '20 at 20:33
  • I aded %matplotlib notebook and I can drag the graph, but it couldn't show the graph growth over time. – Grace Z. Jun 02 '20 at 20:00
  • This [blog post](https://www.allendowney.com/blog/2019/07/25/matplotlib-animation-in-jupyter/) seems to provide a simple solution. – JohanC Jun 03 '20 at 07:20
  • Thank you so much! This is very helpful! – Grace Z. Jun 12 '20 at 21:10

0 Answers0