s452097-plots/plotCreator.py
alicja.m.musial ff3ceac7be plot 10
2020-04-03 20:11:03 +02:00

51 lines
1018 B
Python

import matplotlib.pyplot as plt
import numpy as np
def readFile(file):
with open(file, 'r') as inFile:
countL = 0
for line in inFile:
countL += 1
y2 = np.genfromtxt(file)
return countL, y2
def createplotWER():
ans = readFile('wer.txt')
# Data for plotting
x = np.arange(1, ans.countL)
y = ans.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('wer.png')
plt.show()
def createplotSRR():
ans = readFile('srr.txt')
# Data for plotting
x = np.arange(1, ans.countL)
y = ans.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')
plt.show()
if __name__ == '__main__':
createplotWER()
createplotSRR()