[IT]/python.matplotlib
matplotlib.dist_table
givemebro
2020. 4. 7. 14:30
반응형
dist_table=np.array([[(((data[i]-data[j])**2).sum())**0.5 for j in range(150)]for i in range(150)])
array([[0. , 0.53851648, 0.50990195, ..., 4.45982062, 4.65080638,
4.14004831],
[0.53851648, 0. , 0.3 , ..., 4.49888875, 4.71805044,
4.15331193],
[0.50990195, 0.3 , 0. , ..., 4.66154481, 4.84871117,
4.29883705],
...,
[4.45982062, 4.49888875, 4.66154481, ..., 0. , 0.6164414 ,
0.64031242],
[4.65080638, 4.71805044, 4.84871117, ..., 0.6164414 , 0. ,
0.76811457],
[4.14004831, 4.15331193, 4.29883705, ..., 0.64031242, 0.76811457,
0. ]])
fig=plt.figure(figsize=[10,10])
plt.imshow(dist_table,cmap='gray')
plt.colorbar()
fig=plt.figure(figsize=[10,10])
plt.imshow(dist_table,cmap='gray_r',vmin=0,vmax=dist_table.max())
plt.colorbar()
plt.plot(dist_table[0])
plt.plot(dist_table)
반응형