import matplotlib.pyplot as plt import csv x = [] y = [] i = 0 with open('averagesrr.txt','r') as csvfile: plots = csv.reader(csvfile, delimiter=' ') for row in plots: x.append(float(row[0])) y.append(int(i)) i=i+1 plt.plot(x,y, label='SRR') plt.xlabel('SRR') plt.ylabel('Numer') plt.title('Average plot SRR') plt.legend() plt.savefig('plotsrr.png')