s452097-plots/plotCreator.py
alicja.m.musial 90b689a62e plot 21
2020-04-03 21:02:38 +02:00

40 lines
862 B
Python

import matplotlib.pyplot as plt
import numpy as np
def readFile(file, y):
with open(file, 'r') as inFile:
for line in inFile:
y.append(float(line.strip()))
return y;
def createplotWER():
y = []
y = readFile('werForPlot.txt', y)
fig, ax = plt.subplots()
ax.plot(list(range(1, len(y) + 1)), y)
ax.set(xlabel='Build number', ylabel='Percent [%]',
title='Metric for ASR')
ax.grid()
fig.savefig('wer.png')
plt.show()
def createplotSRR():
x = []
y = []
y = readFile('srrForPlot.txt', y)
fig, ax = plt.subplots()
ax.plot(list(range(1, len(y) + 1)), y)
ax.set(xlabel='Build number', ylabel='Percent [%]',
title='Metric for ASR')
ax.grid()
fig.savefig('srr.png')
plt.show()
if __name__ == '__main__':
createplotWER()
createplotSRR()