-
Notifications
You must be signed in to change notification settings - Fork 12
/
plot.py
36 lines (33 loc) · 877 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
import numpy as np
import matplotlib.pyplot as plt
def readFile(filename):
f = open(filename)
sizes = [40]
times = [0.0]
title = ''
try:
title = f.readline()
# skip 1 line
f.readline()
while True:
line = f.readline()
if line:
slices = line.split(" ")
if len(slices) <= 2:
break;
size = int(slices[0])
time = float(slices[1])
sizes.append(size)
times.append(time)
finally:
f.close()
return title, sizes, times
if __name__ == '__main__':
plt.xlabel('size')
plt.ylabel('gflops')
t1, x1, y1 = readFile('output_old.m')
plt.plot(x1, y1, label=t1)
t2, x2, y2 = readFile('output_new.m')
plt.plot(x2, y2, label=t2)
plt.legend()
plt.show()