-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathshow_data.py
More file actions
25 lines (19 loc) · 828 Bytes
/
show_data.py
File metadata and controls
25 lines (19 loc) · 828 Bytes
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
import time
import pandas as pd
import matplotlib.pyplot as plt
def main():
data = pd.read_csv(f'DATA/normalized_data/training/H/H_1.csv', sep=',', decimal='.')
fig, axs = plt.subplots(2, sharex=True, sharey=False)
axs[0].plot(data.index, data['accX'], label='X-axis')
axs[0].plot(data.index, data['accY'], label='Y-axis')
axs[0].plot(data.index, data['accZ'], label='Z-axis')
axs[0].set(title='Accelerometer data', xlim=(0, data.index.max()))
axs[1].plot(data.index, data['gyrX'], label='X-axis')
axs[1].plot(data.index, data['gyrY'], label='Y-axis')
axs[1].plot(data.index, data['gyrZ'], label='Z-axis')
axs[1].set(title='Gyroscope data', xlim=(0, data.index.max()))
plt.legend()
plt.show()
time.sleep(1)
if __name__ == "__main__":
main()