Click here to Skip to main content
15,358,470 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to replace names of graph nodes with items from a list knowing that I have multiple lists for multiple graphs. So the nodes will change i.e. the list.

What I have tried:

import matplotlib.pyplot as plt
   import networkx as nx
   G = nx.from_numpy_array(x)

   nx.draw(G,node_size=500,arrowsize=200,node_color='green', edge_color='red',font_size=10, with_labels=True)
   print("number of edges is:",G.number_of_edges())
   print("number of nodes is:",G.number_of_nodes())
Updated 26-Apr-22 9:05am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900