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:
trajDataFrame

The DataFrame should include time and spatial coordinate columns.

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

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

labelboolean, optional

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

superimposendarray, optional

Background image, default None

cmapcolormap, optional

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

axmatplotlib axes object, optional

Defaults to current axes

t_columnstring, optional

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

pos_columnslist of strings, optional

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

plot_styledictionary

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

Returns:
Axes object

See also

plot_traj3d

the 3D equivalent of plot_traj