-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlot.py
More file actions
68 lines (28 loc) · 725 Bytes
/
Copy pathPlot.py
File metadata and controls
68 lines (28 loc) · 725 Bytes
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
import matplotlib.pyplot as plt
QueueVersions = ["dlsm", "globallock", "klsm", "multiq"]
color = ['b', 'g', 'r', 'y']
f = open('RunTimes.txt', 'r')
plt.xlabel('number of threads')
plt.ylabel('runtime in seconds')
mx = 0.0
for i in range(0, 4):
x = []
y = []
j = 1
k = 0
while j <= 32:
line = f.readline()
a = line.split(' ')
x.append(int(a[0]))
y.append(float(a[1]))
if float(a[1]) > mx: mx = float(a[1])
j *= 2
k += 1
plt.plot(x, y, '.'+color[i]+'-') #plot dijkstra with locks in red
line = f.readline()
a = line.split(' ')
#plt.plot(int(a[0]), float(a[1]), 'k')
#if float(a[1]) > mx: mx = float(a[1])
plt.ylim(0.0, mx)
print float(a[1])
plt.show()