import matplotlib.pyplot as plt import numpy as np import itertools import csv limit = 140 x = np.arange(1, limit) y1 = [] y2 = [] y3 = [] y4 = [] with open('data1.csv', 'r') as datafile: data = csv.reader(datafile, delimiter=',') for rows in itertools.islice(data, 1, limit): y1.append(float(rows[1])) with open('data2.csv', 'r') as datafile: data = csv.reader(datafile, delimiter=',') for rows in itertools.islice(data, 1, limit): y2.append(float(rows[1])) with open('data3.csv', 'r') as datafile: data = csv.reader(datafile, delimiter=',') for rows in itertools.islice(data, 1, limit): y3.append(float(rows[1])) with open('data4.csv', 'r') as datafile: data = csv.reader(datafile, delimiter=',') for rows in itertools.islice(data, 1, limit): y4.append(float(rows[1])) plt.plot(x, y1, color="blue") plt.plot(x, y2, color="red") plt.plot(x, y3, color="green") plt.plot(x, y4, color="brown") plt.axis([0, 150, 0, 360]) plt.title('Comparing Degrees On The Compass From Walking \n Up/Down Different Hewitt Staircases') plt.xlabel('Time of Taking the Staircase') plt.ylabel('Degrees on the Compass') plt.legend(["Teachers Mezzanine Staircase","Stillman Staircase","Stillman Spiral Staircase","Back Entrance Staircase"], loc ="upper left") plt.show()