pymovements.plotting.traceplot#

pymovements.plotting.traceplot(gaze: GazeDataFrame, position_column: str = 'pixel', cval: np.ndarray | None = None, cmap: colors.Colormap | None = None, cmap_norm: colors.Normalize | str | None = None, cmap_segmentdata: dict[str, list[list[float]]] | None = None, cbar_label: str | None = None, show_cbar: bool = False, padding: float | None = None, pad_factor: float | None = 0.05, figsize: tuple[int, int] = (15, 5), title: str | None = None, savepath: str | None = None, show: bool = True) None[source]#

Plot eye gaze trace from positional data.

Parameters:
  • gaze (GazeDataFrame) – The GazeDataFrame to plot.

  • position_column (str, optional) – The column name of the x and y position data

  • cval (np.ndarray) – line color values.

  • cmap (matplotlib.colors.Colormap, optional) – color map for line color values

  • cmap_norm (matplotlib.colors.Normalize, str, optional) – normalization for color values.

  • cmap_segmentdata (dict, optional) – color map segmentation to build color map

  • cbar_label (str, optional) – string label for color bar

  • show_cbar (bool) – Shows color bar if True.

  • padding (float, optional) – Absolute padding value. If None it is inferred from pad_factor and limits.

  • pad_factor (float, optional) – Relative padding factor to construct padding value if not given.

  • figsize (tuple) – Figure size.

  • title (str, optional) – Figure title.

  • savepath (str, optional) – If given, figure will be saved to this path.

  • show (bool) – If True, figure will be shown.

Raises:

ValueError – If length of x and y coordinates do not match or if cmap_norm is unknown.