Skip to content

Commit

Permalink
Fix distance to time plot (#368)
Browse files Browse the repository at this point in the history
During the plotting the time was divided by the frame rate, which is
not needed here. This resulted in wrong times displayed in the plot.
Removed the wrong division.
  • Loading branch information
schroedtert authored Aug 30, 2024
1 parent 303e3c9 commit 8d2ff31
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pedpy/plotting/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,6 @@ def plot_neighborhood(
def plot_time_distance(
*,
time_distance: pd.DataFrame,
frame_rate: float,
axes: Optional[matplotlib.axes.Axes] = None,
**kwargs: Any,
) -> matplotlib.axes.Axes:
Expand All @@ -468,7 +467,6 @@ def plot_time_distance(
Args:
time_distance(pd.DataFrame): DataFrame containing information on time and
distance to some target
frame_rate(float): frame_rate of the trajectory
axes (matplotlib.axes.Axes): Axes to plot on, if None new will be created
marker_color (optional): color of the markers on the plot
line_color (optional): color of the lines on the plot
Expand All @@ -492,15 +490,15 @@ def plot_time_distance(
for _, ped_data in time_distance.groupby(by=ID_COL):
axes.plot(
ped_data.distance,
ped_data.time / frame_rate,
ped_data.time,
color=line_color,
alpha=0.7,
lw=0.25,
)
min_data = ped_data[ped_data.frame == ped_data.frame.min()]
axes.scatter(
min_data.distance,
min_data.time / frame_rate,
min_data.time,
color=marker_color,
s=5,
marker="o",
Expand Down

0 comments on commit 8d2ff31

Please sign in to comment.