def plot_accelerometer(self):
"""Plot accelerometer"""
accel_x = [data["af"] for data in self.oxts]
accel_y = [data["al"] for data in self.oxts]
accel_z = [data["au"] for data in self.oxts]
fig = plt.figure()
ax1 = fig.add_subplot(311)
ax2 = fig.add_subplot(312)
ax3 = fig.add_subplot(313)
ax1.plot(self.timestamps, accel_x)
ax2.plot(self.timestamps, accel_y)
ax3.plot(self.timestamps, accel_z)
plt.suptitle("Accelerometer")
ax1.set_xlabel("Date Time")
ax1.set_ylabel("ms^-2")
ax2.set_xlabel("Date Time")
ax2.set_ylabel("ms^-2")
ax2.set_xlabel("Date Time")
ax3.set_ylabel("ms^-2")
ax1.set_xlim([self.timestamps[0], self.timestamps[-1]])
ax2.set_xlim([self.timestamps[0], self.timestamps[-1]])
ax3.set_xlim([self.timestamps[0], self.timestamps[-1]])
fig.tight_layout()
评论列表
文章目录