25 lines
472 B
Python
Executable File
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()
|