forked from FRCTeam2910/Common
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraph_csv.py
41 lines (32 loc) · 815 Bytes
/
graph_csv.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env python3
import matplotlib.pyplot as plt
import numpy as np
data = np.genfromtxt('trajectory.csv', delimiter=',', names=True)
plt.figure(1, figsize=(12, 8))
plt.subplot(231)
plt.xlabel('X')
plt.ylabel('Y')
plt.title('Path')
plt.plot(data['x'], data['y'])
plt.subplot(232)
plt.xlabel('Time')
plt.ylabel('Feedforward')
plt.title('Feedforward')
plt.plot(data['time'], data['f'])
plt.subplot(234)
plt.xlabel('Time')
plt.ylabel('Position')
plt.title('Position')
plt.plot(data['time'], data['position'])
plt.subplot(235)
plt.xlabel('Time')
plt.ylabel('Velocity')
plt.title('Velocity')
plt.plot(data['time'], data['velocity'])
plt.subplot(236)
plt.xlabel('Time')
plt.ylabel('Acceleration')
plt.title('Acceleration')
plt.plot(data['time'], data['acceleration'])
plt.suptitle('Trajectory')
plt.show()