-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot_darkies.py
35 lines (33 loc) · 972 Bytes
/
plot_darkies.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
import matplotlib.pyplot as plt
import numpy as np
import os
import glob
darkies = []
idx = 0
for darkie in glob.glob('log/darkie[0-9]*.log'):
with open(darkie) as f:
buf = f.read()
lines = buf.split('\n')
apr = float(lines[2].split(':')[1].strip())
aprs = [float(item) if item != ' ' else 0 for item in lines[3].split(':')[1].split(',')]
initial_stake = [float(item) for item in lines[0].split(':')[1].split(',')]
idx +=1
darkies += [(initial_stake, apr, aprs, idx)]
plt.figure()
# plot initial stake
for darkie in darkies:
plt.plot(darkie[0])
plt.title('initial stake')
legends = []
for darkie in darkies:
legend = ["darkie{}".format(darkie[3])]
legends +=[legend]
#plt.legend(legends, loc='upper left')
plt.savefig("log/plot_darkies_is.png")
plt.close()
plt.figure()
for darkie in darkies:
plt.plot(darkie[2])
plt.title('APR')
plt.savefig('log/plot_darkies_mil_apr.png')
plt.close()