Skip to content

Commit

Permalink
fix: time_distance plot initial point
Browse files Browse the repository at this point in the history
Did not plot the initial position of all pedestrians as a scatter plot, if not all pedestrian's trajectories started at the same frame
  • Loading branch information
Kilidsch authored and schroedtert committed Feb 21, 2025
1 parent 702e642 commit 0e5e402
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pedpy/plotting/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,10 +804,10 @@ def _scatter_min_data(
Args:
axes: The matplotlib axes to plot on.
ped_data: DataFrame containing a single pedestrian's data.
ped_data: DataFrame containing pedestrian data.
color: Color of the scatter plot marker.
"""
min_data = ped_data[ped_data.frame == ped_data.frame.min()]
min_data = ped_data.loc[ped_data.groupby(ID_COL)[FRAME_COL].idxmin()]
axes.scatter(
min_data.distance,
min_data.time,
Expand All @@ -825,13 +825,13 @@ def _scatter_min_data_with_color(
Args:
axes: The matplotlib axes to plot on.
ped_data: DataFrame containing a single pedestrian's data.
ped_data: DataFrame containing pedestrian data.
norm: Normalization for the colormap based on speed.
cmap: The colormap to use for coloring the line based on speed.
frame_rate: Frame rate used to adjust time values.
color: Color of the scatter plot marker.
"""
min_data = ped_data[ped_data.frame == ped_data.frame.min()]
min_data = ped_data.loc[ped_data.groupby(ID_COL)[FRAME_COL].idxmin()]
axes.scatter(
min_data.distance,
min_data.time,
Expand Down

0 comments on commit 0e5e402

Please sign in to comment.