import matplotlib.pyplot as plt import numpy as np import itertools import csv limit = 50 x = np.arange(1, limit) y1 = [] y2 = [] with open("data1down.csv", "r") as datafile: data = csv.reader(datafile, delimiter=",") for rows in itertools.islice(data, 1, limit): y1.append(float(rows[1])) with open("data2up.csv", "r") as datafile: data = csv.reader(datafile, delimiter=",") for rows in itertools.islice(data, 1, limit): y2.append(float(rows[1])) plt.plot(x, y1, color="red") plt.plot(x, y2, color="blue") plt.axis([0, 50, 7, 11]) plt.title("Elevator Time: Up vs Down") plt.xlabel("Time: hundredths of a second") plt.ylabel("Accel Z axis values") plt.legend(["down", "up"], loc="upper left") plt.show()