-
Notifications
You must be signed in to change notification settings - Fork 0
/
makeGraphs.py
42 lines (32 loc) · 1.02 KB
/
makeGraphs.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
import os,sys;sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))))
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
for i in range(3):
file = open("epGreedyAnnealingScaledResults" + str(i) + ".txt","r")
file.readline()
data = file.read()
print(data)
data = data.split("\n")
for j in range(len(data)):
#print(data[j])
data[j] = data[j].split()
fig = plt.figure()
print("test")
#fig.set_title("Z Coords")
#fig.set_xlabel("t")
#fig.set_ylabel("Z Approximation")
numbers = np.zeros(len(data))
zs = np.zeros(len(data))
for j in range(len(data)):
if (data[j][0] != ''):
zs[j] = float(data[j][6])
numbers[j] = j
#print(data)
mpl.pyplot.plot(numbers, zs)
mpl.pyplot.xlabel("t")
mpl.pyplot.ylabel("Z Values")
fig.show()
fig.savefig("zAnnealingScaled" + str(i) + ".png")
file.close()
print("done")