trackpy.plot_traj

trackpy.plot_traj(traj, colorby='particle', mpp=None, label=False, superimpose=None, cmap=None, ax=None, t_column=None, pos_columns=None, plot_style={}, **kwargs)

Plot traces of trajectories for each particle. Optionally superimpose it on a frame from the video.

Parameters:

traj : DataFrame

The DataFrame should include time and spatial coordinate columns.

colorby : {‘particle’, ‘frame’}, optional

mpp : float, optional

Microns per pixel. If omitted, the labels will have units of pixels.

label : boolean, optional

Set to True to write particle ID numbers next to trajectories.

superimpose : ndarray, optional

Background image, default None

cmap : colormap, optional

This is only used in colorby=’frame’ mode. Default = mpl.cm.winter

ax : matplotlib axes object, optional

Defaults to current axes

t_column : string, optional

DataFrame column name for time coordinate. Default is ‘frame’.

pos_columns : list of strings, optional

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

plot_style : dictionary

Keyword arguments passed through to the Axes.plot(...) command

Returns:

Axes object

See also

plot_traj3d
the 3D equivalent of plot_traj