-
Notifications
You must be signed in to change notification settings - Fork 0
/
parse.py
61 lines (47 loc) · 1.08 KB
/
parse.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import os
import img2pdf
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import sys
import string
name=sys.argv[1].split('.')[0]
print("name="+name)
path = "Tool_Data/"
file = open(path+sys.argv[1],'r')
data = []
headers = []
h = 1
for i in file:
s=i[:-1]
data.append(s.split('\t'))
print(s.split('\t'))
file.close()
headers = data[0]
data = data[1:-1]
headers
n = len(headers)
y = [i for i in range(0,n)]
with PdfPages('./Tool_Output/'+name+'.pdf') as pdf:
for i in data:
title = i[0]
val = i[1:]
# OFF = i[6:]
print(title,val)
for num in range(0,n):
val[num] = eval(val[num])
# print(y)
# break
plt.clf()
plt.bar(y, val, align='center', alpha=0.5)
plt.xticks(y, headers,rotation=90)
plt.ylabel(title)
plt.title(name)
# plt.bar(y,ON,label="Tungsten ON")
# plt.plot(y,OFF,label="Tungsten OFF")
# plt.xlabel('Benchmark Size', fontsize=14)
# plt.ylabel(title, fontsize=14)
# plt.xticks([0,1,2,3,4],['1B','2B','3B','4B','5B'])
# plt.grid(axis='y', linestyle='-')
# plt.legend()
plt.tight_layout()
pdf.savefig()