s152203-plots/plot.py
Yevheniia Tsapkova 6cc2dff872 generating plots
2020-04-03 16:11:57 +02:00

22 lines
560 B
Python

#!/usr/bin/env python3
import matplotlib.pyplot as plt
def read_into_file(file_name: str) -> list:
with open(file_name, 'r') as f:
return f.read().splitlines()
def generate_plot(data: list, label: str, file_name: str):
plt.plot(data)
plt.ylabel(label)
plt.savefig(file_name)
plt.close()
if __name__ == '__main__':
wer = [float(i) for i in read_into_file('wer-generate.txt')]
srr = [float(i) for i in read_into_file('srr-generate.txt')]
generate_plot(wer, 'WER', 'wer.png')
generate_plot(srr, 'SRR', 'srr.png')