-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot.py
36 lines (27 loc) · 849 Bytes
/
plot.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
from matplotlib import pyplot as plt
import numpy as np
fig = plt.figure()
fps = 30
tau_max = 5
data = np.loadtxt('./tmp/result_offset_ncc.txt')
data = data.reshape(tau_max, -1, 3)
for t in np.arange(tau_max):
plt.subplot(5, 2, 2 * t+1)
plt.plot(data[t][:,0], data[t][:,2], label='tau = {:d}'.format(t+1))
plt.xlim([-1,5])
plt.legend()
plt.subplot(2,2,2)
vicon = np.loadtxt('./tmp/vicon_rotation_before.txt')
phone = np.loadtxt('./tmp/phone_rotation_before.txt')
x = np.arange(len(vicon)) / fps
plt.plot(x, vicon, label='vicon')
plt.plot(x, phone, label='phone')
plt.legend()
plt.subplot(2,2,4)
vicon = np.loadtxt('./tmp/vicon_rotation_after.txt')
phone = np.loadtxt('./tmp/phone_rotation_after.txt')
x = np.arange(len(vicon)) / fps
plt.plot(x, vicon, label='vicon')
plt.plot(x, phone, label='phone')
plt.legend()
plt.show()