import matplotlib.pyplot as plt import networkx as nx G = nx.from_numpy_array(x) #G.add_nodes_from(new_list) nx.draw(G,node_size=500,arrowsize=200,node_color='green', edge_color='red',font_size=10, with_labels=True) plt.show() print("number of edges is:",G.number_of_edges()) print("number of nodes is:",G.number_of_nodes())
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)