Skip to content

Commit

Permalink
Create plot_results.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrouch authored Sep 22, 2024
1 parent 4217fc4 commit 75be7f5
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions bbn_wave_freq_m5atomS3/tests/plot_results.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import numpy as np
import matplotlib.pyplot as plt

Data = np.loadtxt(fname="results.csv", delimiter=",",
usecols=(1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27),
skiprows=0)

Time = Data[:, [0]]
AccX = Data[:, [1]]
RefVelX = Data[:, [2]]
RefPosX = Data[:, [3]]
Heave = Data[:, [4]]
HeaveAlt = Data[:, [5]]

f, axarr = plt.subplots(3, sharex="all")

axarr[0].set_title('Acceleration X')
axarr[0].plot(Time, AccX, label="Input AccX")
axarr[0].grid()
axarr[0].legend()

axarr[1].set_title('Velocity X')
axarr[1].plot(Time, RefVelX, label="Reference VelX")
axarr[1].grid()
axarr[1].legend()

axarr[2].set_title('Position X')
axarr[2].plot(Time, RefPosX, label="Reference PosX")
axarr[2].plot(Time, Heave, "r-", label="Heave")
axarr[2].plot(Time, HeaveAlt, "g-", label="HeaveAlt")
axarr[2].grid()
axarr[2].legend()

plt.show()

0 comments on commit 75be7f5

Please sign in to comment.