NetworkX-simple graph
1 import networkx as nx 2 import matplotlib.pyplot 3 import scipy.io as sio 4 import numpy as np 5 6 load_path='H:/summer/datasets_read/chb01/Seizure/cut/wc/03.mat' 7 load_data=sio.loadmat(load_path) 8 9 # print(type(load_data)) 10 # print(load_data.keys()) 11 # print(load_data.values()) 12 print(load_data['R']) 13 14 Matrix=np.array(load_data['R']) 15 g = nx.Graph() 16 17 for i in range(len(Matrix)): 18 for j in range(len(Matrix)): 19 g.add_edge(i,j) 20 21 nx.draw(g) 22 matplotlib.pyplot.show()
Guess What??
Funny ,HA~