import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt 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')