trackpy.plot_displacements

trackpy.plot_displacements(t, frame1, frame2, scale=1, ax=None, pos_columns=None, **kwargs)

Plot arrows showing particles displacements between two frames.

Parameters:
tDataFrame

trajectories, including columns ‘frame’ and ‘particle’

frame1integer

frame number

frame2integer

frame number

scalefloat

scale factor, if 1 (default) then arrow end is placed at particle destination; if any other number arrows are rescaled

pos_columnslist of strings, optional

Dataframe column names for spatial coordinates. Default is [‘x’, ‘y’].

axmatplotlib axes (optional)

Notes

Any other keyword arguments will pass through to matplotlib’s annotate.