-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_ClusterIndex.py
51 lines (35 loc) · 1.15 KB
/
test_ClusterIndex.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
46
47
48
49
50
51
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jul 17 12:44:16 2022
@author: adrian
"""
fig, ax = plt.subplots(figsize =(10, 7))
plt.figure(figsize=(10, 6))
hist1=plt.hist2d(u[L,0], u[L,1],100,density=1,cmap='Reds',alpha=0.6) #OR
hist2=plt.hist2d(u[M,0], u[M,1],100,density=1,cmap='Blues',alpha=0.6) #OD
#HC
#con
plt.colorbar(hist1, orientation='vertical')
plt.colorbar(hist2, orientation='vertical')
plt.show()
cmb=plt.colorbar()
cmb.mappable.set_clim(vmin=0, vmax=0.25)
cmb.set_label('Density')
#sm=plt.cm.ScalarMappable(cmap=colormap)
sm=plt.cm.ScalarMappable()
#sm.set_clim(vmin=np.min(z),vmax=np.max(z))
sm.set_clim(vmin=0,vmax=0.2)
ax.set_xlabel('UMAP1')
ax.set_ylabel('UMAP2')
#plt.colorbar(sm)
#plt.xlabel("UMAP1")
#plt.ylabel("UMAP2")
plt.title(string)
# show plot
plt.tight_layout()
plt.show()
import pandas as pd
df=pd.DataFrame(u, columns=['u1','u2','u3','u4'])
Meanfreq
cI_val, bLab, _=URC_computeClusterIndex_V4.computeClusterIndex_V4(df,Meanfreq,10,['u1','u2'],plotCluster=0,vmin=100, vmax=250)