s452097-plots/plotCreator.py

50 lines
1004 B
Python
Raw Normal View History

2020-04-03 19:12:13 +02:00
import matplotlib.pyplot as plt
import numpy as np
def readFile(file):
with open(file, 'r') as inFile:
countL = 0
for line in open(thefilepath).xreadlines( ): countL += 1
y2 = np.genfromtxt(file)
return countL, y2
2020-04-03 19:52:09 +02:00
def createplotWER():
2020-04-03 19:12:13 +02:00
2020-04-03 19:52:09 +02:00
readFile('wer.txt')
2020-04-03 19:12:13 +02:00
# Data for plotting
x = np.arange(1, countL)
y = y2
fig, ax = plt.subplots()
ax.plot(x, y)
2020-04-03 19:40:36 +02:00
ax.set(xlabel='Build number', ylabel='Percent [%]',
2020-04-03 19:39:11 +02:00
title='Metric for ASR')
2020-04-03 19:12:13 +02:00
ax.grid()
2020-04-03 19:47:43 +02:00
name = sourceFile.rstrip('.')
2020-04-03 19:52:09 +02:00
fig.savefig('wer.png')
plt.show()
def createplotSRR():
readFile('srr.txt')
# Data for plotting
x = np.arange(1, countL)
y = y2
fig, ax = plt.subplots()
ax.plot(x, y)
ax.set(xlabel='Build number', ylabel='Percent [%]',
title='Metric for ASR')
ax.grid()
name = sourceFile.rstrip('.')
fig.savefig('srr.png')
2020-04-03 19:12:13 +02:00
plt.show()
if __name__ == '__main__':
2020-04-03 19:52:09 +02:00
createplotWER()
createplotSRR()