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 42 43 44 45
| import matplotlib.pyplot as plt import pandas as pd
def plot_ACC(path): df = pd.read_csv(path) print(df) fig, axes = plt.subplots(3, 1, figsize=(36, 10))
axes[0].scatter(df['Timestamp'], df['X'], c='red', marker='1', label='X Acc') axes[0].set_xlabel('time') axes[0].set_ylabel('g or mg') axes[0].legend(loc=2)
axes[1].scatter(df['Timestamp'], df['Y'], c='blue', marker='2', label='Y Acc') axes[1].set_xlabel('time') axes[1].set_ylabel('g or mg') axes[1].legend(loc=2)
axes[2].scatter(df['Timestamp'], df['Z'], c='green', marker='3', label='Z Acc') axes[2].set_xlabel('time') axes[2].set_ylabel('g or mg') axes[2].legend(loc=2)
def plot_ECG(path): df = pd.read_csv(path) print(df) fig = plt.figure(figsize=(36, 10)) ax = fig.add_subplot() ax.scatter(df['Timestamp'], df['ECG'], c='red', marker='1', label='ECG') ax.set_xlabel('time') ax.set_ylabel('mV') ax.legend(loc=2)
iPhone_path = '20240128/CSV/iPhone_ACC_date.csv_CUT/9.csv' Polar_ACC_path = '20240128/CSV/Polar_ACC_date.csv_CUT/9.csv' Polar_ECG_path = '20240128/CSV/Polar_ECG_date.csv_CUT/9.csv'
plot_ECG(Polar_ECG_path) plot_ACC(iPhone_path) plot_ACC(Polar_ACC_path)
plt.show()
|