Skip to content

Commit

Permalink
solve compatibility issue from pandas (#452)
Browse files Browse the repository at this point in the history
Co-authored-by: Jun Chen <jun.chen@ipvs.uni-stuttgart.de>
  • Loading branch information
Fujikawas and Jun Chen authored Jan 30, 2024
1 parent b1e74d7 commit f377815
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions oscillator/plot-trajectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="*")
Expand Down

0 comments on commit f377815

Please sign in to comment.