forked from KevinMenden/TMHProjectFinal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlot.py
51 lines (39 loc) · 876 Bytes
/
Plot.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
__date__ = '07.06.2016'
import numpy as np
import matplotlib.pyplot as plt
import sys
tm_file = open("tm_file.txt")
glob_file = open("glob_file.txt")
tm_x = []
tm_y = []
gl_x = []
gl_y = []
tline = tm_file.readline()
while tline:
s = tline.split()
x = int(s[0])
y = int(s[1].replace("\n", ""))
tm_x.append(x)
tm_y.append(y)
tline = tm_file.readline()
gline = glob_file.readline()
while gline:
s = gline.split()
x = int(s[0])
y = int(s[1].replace("\n", ""))
gl_x.append(x)
gl_y.append(y)
gline = glob_file.readline()
tm_file.close()
glob_file.close()
xmax = 40
ymax = 50
x = gl_x
y = gl_y
hist, xedges, yedges = np.histogram2d(x, y, bins=range(ymax))
plt.pcolor(xedges, yedges, hist, cmap=plt.cm.YlOrRd_r)
plt.colorbar()
plt.title("Globular helices")
plt.xlabel("Length")
plt.ylabel("Hydrophobic residues")
plt.show()