-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplotter.py
More file actions
55 lines (51 loc) · 1.28 KB
/
Copy pathplotter.py
File metadata and controls
55 lines (51 loc) · 1.28 KB
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
52
53
import matplotlib.pyplot as plt
save_file = 'ssh_out.csv'
plt.axis([0, 0.8, 0, 1])
plt.grid(True)
dic = {}
with open(save_file, 'r') as ff:
for line in ff:
# input('continue?')
plt.close()
# plt.grid(True)
if '----' in line:
# ATTENTION HERE
print(line[40:-1])
dic = {}
continue
for beta in dic:
x = dic[beta]
sm = 0
cnt = 0
for mag in x:
sm += mag
cnt += 1
if cnt != 0:
sm /= cnt
plt.scatter(beta, sm, c='#a60d36', marker='.')
plt.pause(0.0001)
dic = {}
print(line)
else:
line = line.split(';')
beta = float(line[0])
mag = float(line[1])
# print('{} {}'.format(beta, mag))
if beta not in dic:
dic[beta] = []
dic[beta].append(mag)
plt.close()
plt.axis([0, 0.8, 0, 1])
plt.grid(True)
for beta in dic:
x = dic[beta]
sm = 0
cnt = 0
for mag in x:
sm += mag
cnt += 1
if cnt != 0:
sm /= cnt
plt.scatter(beta, sm, c='#a60d36', marker='.')
plt.pause(0.0001)
plt.show()