s452094-plots/plot.py

32 lines
564 B
Python
Raw Normal View History

2020-04-03 19:22:25 +02:00
import matplotlib
2020-04-03 19:20:40 +02:00
matplotlib.use('Agg')
2020-04-03 19:22:25 +02:00
import matplotlib.pyplot as plt
2020-04-03 20:50:18 +02:00
import csv
x1 = []
y1 = []
x2 = []
y2 = []
counter = 0
with open('wer.txt','r') as txtfile:
plots = csv.reader(txtfile)
for row in plots:
x1.append(counter)
y1.append(float(row[0]))
counter += 1
counter = 0
with open('srr.txt','r') as txtfile:
plots = csv.reader(txtfile)
for row in plots:
x2.append(counter)
y2.append(float(row[0]))
counter += 1
plt.plot(x1,y1,x2,y2)
plt.title('Wykres')
plt.legend()
#plt.show()
plt.savefig('plot.png')