Skip to content

Commit

Permalink
Tweak plotting script (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
andebjor authored Jul 27, 2023
1 parent f70cfb6 commit 9688911
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions scripts/plot_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@ def plot(csvfile):
"""

df = pd.read_csv(csvfile, index_col='time')
df = pd.read_csv(csvfile, index_col='time', sep=";")

fig, axes = plt.subplots(5, 1, sharex=True)

df[['ay', 'az']].plot(ax=axes[0])

df['wz'].pot(ax=axes[1])
df['wx'].plot(ax=axes[1])

df[['theta_a', 'theta_af']].apply(np.rad2deg).plot(axes[2])
df[['theta_a', 'theta_af']].apply(np.rad2deg).plot(ax=axes[2])

df[['theta_g', 'theta_gf']].apply(np.rad2deg).plot(axes[3])
df[['theta_g', 'theta_gf']].apply(np.rad2deg).plot(ax=axes[3])

df['theta'].apply(np.rad2deg).plot(axes[4])
df['theta'].apply(np.rad2deg).plot(ax=axes[4])

return axes

Expand All @@ -57,5 +57,6 @@ def plot(csvfile):
parser.add_argument('csvfile')
args = parser.parse_args()

plot(args.csvfile)
axis = plot(args.csvfile)
# axis[0].
plt.show()

0 comments on commit 9688911

Please sign in to comment.