dawjur-mlworkshops-plots/plot.py
Dawid Jurkiewicz 80818be6fd add labels
2020-04-03 15:11:36 +02:00

25 lines
472 B
Python
Executable File

#!/usr/bin/env python
import matplotlib.pyplot as plt
import sys
def read_file(filename):
values = []
with open(filename) as f:
for line in f:
values.append(float(line.rstrip('\n')))
return values
def main():
values = read_file(sys.argv[1])
plt.plot(values)
plt.xlabel('runs')
plt.ylabel(sys.argv[1].replace('.txt', ''))
plt.savefig(sys.argv[2], dpi=1000)
plt.close()
if __name__ == "__main__":
main()