From f37781559c1ad3e67638f024874aaa8ca789e581 Mon Sep 17 00:00:00 2001 From: June <94080048+Fujikawas@users.noreply.github.com> Date: Tue, 30 Jan 2024 10:11:23 +0100 Subject: [PATCH] solve compatibility issue from pandas (#452) Co-authored-by: Jun Chen --- oscillator/plot-trajectory.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/oscillator/plot-trajectory.py b/oscillator/plot-trajectory.py index bec248cd6..e5f2558ac 100644 --- a/oscillator/plot-trajectory.py +++ b/oscillator/plot-trajectory.py @@ -19,13 +19,13 @@ class PlotType(Enum): df = pd.read_csv(filename, delimiter=';') if args.plotType == PlotType.U_OVER_T.name: - plt.plot(df['time'], df['position']) + plt.plot(df['time'].to_numpy(), df['position'].to_numpy()) plt.title(PlotType.U_OVER_T.value) elif args.plotType == PlotType.V_OVER_T.name: - plt.plot(df['time'], df['velocity']) + plt.plot(df['time'].to_numpy(), df['velocity'].to_numpy()) plt.title(PlotType.V_OVER_T.value) elif args.plotType == PlotType.TRAJECTORY.name: - plt.plot(df['position'], df['velocity']) + plt.plot(df['position'].to_numpy(), df['velocity'].to_numpy()) plt.scatter([df['position'][0]], [df['velocity'][0]], label=f"(u,v) at t={df['time'][0]}") plt.scatter([df['position'].iloc[-1]], [df['velocity'].iloc[-1]], label=f"(u,v) at t={df['time'].iloc[-1]}", marker="*")