Posts

Showing posts with the label networkx

Unexpected error while drawing networkx graph

7 I have a simple graph and need to draw it on my screen, here is my code: def gera_grafo(matriz): grafo = nx.to_networkx_graph(matriz, create_using=nx.Graph) nx.draw(grafo) plt.show() return grafo Where matrix is an adjacency list containing the weights of the connections. The coda was working just fine, but i had to create a new python virtualenv and since then, even though all the required libraries are correctly installed it throws an error on the nx.draw() call. The error I got is: Traceback (most recent call last): File "/run/media/luisola/A216C03316C009ED/Users/Luis/Documents/Iniciação Científica/inicia-o-cient-fica/venv/lib/python3.9/site-packages/networkx/utils/decorators.py", line 396, in _random_state random_state_arg = args[random_s...