Skip to content
Snippets Groups Projects
Verified Commit f3a73425 authored by orestis.malaspin's avatar orestis.malaspin
Browse files

added legend to numpy scritp

parent 46185110
Branches
No related tags found
No related merge requests found
import numpy as np
import matplotlib.pyplot as plt
time_pos = np.genfromtxt("input.txt", delimiter=",")
......@@ -16,3 +17,8 @@ vel_p1 = np.roll(vel, -1)
acc = (vel_p1 - vel) / (time_p1 - time)
# print(np.mean(acc[0:len(acc)-2]))
plt.plot(time[0:len(pos)], pos, label='position')
plt.plot(time[0:len(vel)-1], vel[0:len(vel)-1], label='velocity')
plt.plot(time[0:len(acc)-2], acc[0:len(acc)-2], label='acceleration')
plt.legend()
plt.show()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment