s452097-plots/plotCreator.py
alicja.m.musial b38c155584 plot 20
2020-04-03 21:01:26 +02:00

40 lines
852 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(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(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()