Skip to content

Commit 8d2ff31

Browse files
authored
Fix distance to time plot (#368)
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.
1 parent 303e3c9 commit 8d2ff31

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

pedpy/plotting/plotting.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,6 @@ def plot_neighborhood(
459459
def plot_time_distance(
460460
*,
461461
time_distance: pd.DataFrame,
462-
frame_rate: float,
463462
axes: Optional[matplotlib.axes.Axes] = None,
464463
**kwargs: Any,
465464
) -> matplotlib.axes.Axes:
@@ -468,7 +467,6 @@ def plot_time_distance(
468467
Args:
469468
time_distance(pd.DataFrame): DataFrame containing information on time and
470469
distance to some target
471-
frame_rate(float): frame_rate of the trajectory
472470
axes (matplotlib.axes.Axes): Axes to plot on, if None new will be created
473471
marker_color (optional): color of the markers on the plot
474472
line_color (optional): color of the lines on the plot
@@ -492,15 +490,15 @@ def plot_time_distance(
492490
for _, ped_data in time_distance.groupby(by=ID_COL):
493491
axes.plot(
494492
ped_data.distance,
495-
ped_data.time / frame_rate,
493+
ped_data.time,
496494
color=line_color,
497495
alpha=0.7,
498496
lw=0.25,
499497
)
500498
min_data = ped_data[ped_data.frame == ped_data.frame.min()]
501499
axes.scatter(
502500
min_data.distance,
503-
min_data.time / frame_rate,
501+
min_data.time,
504502
color=marker_color,
505503
s=5,
506504
marker="o",

0 commit comments

Comments
 (0)