-
Notifications
You must be signed in to change notification settings - Fork 8
/
3.3.Correlation.py
45 lines (34 loc) · 1.02 KB
/
3.3.Correlation.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
#df = pd.read_csv('Data1.csv')
df4 = pd.read_csv('not_alc_s2_conv.csv')
#print (df4)
corr_matrix=df4.values
#fig_cor, axes_cor = plt.subplots()
fig_cor, axes_cor = plt.subplots(1, sharex=True, figsize=(50,100))
#print (fig_cor)
#print (axes_cor)
#print (plt.subplots(1,1))
fig_cor.set_size_inches(6, 6)
x=[]
for b in range (0,256):
x.append(b)
#print (a)
labels_x = x
y=[]
for b in range (0,63):
y.append(b)
#print (a)
labels_y = y
myimage = axes_cor.imshow(corr_matrix)
plt.colorbar(myimage)
axes_cor.set_yticks(np.arange(0,corr_matrix.shape[0], corr_matrix.shape[0]*1.0/len(labels_x)))
axes_cor.set_xticks(np.arange(0,corr_matrix.shape[1], corr_matrix.shape[1]*1.0/len(labels_y)))
#print (np.arange(0,corr_matrix.shape[0], corr_matrix.shape[0]*1.0/len(labels_y)))
#print(np.arange(0,corr_matrix.shape[1], corr_matrix.shape[1]*1.0/len(labels_x)))
axes_cor.set_yticklabels(labels_x)
axes_cor.set_xticklabels(labels_y)
#plt.draw()
plt.tight_layout()
plt.show()