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()