traceplot#

pymovements.plotting.traceplot(gaze: Gaze, position_column: str = 'pixel', cval: np.ndarray | None = None, cmap: matplotlib.colors.Colormap | None = None, cmap_norm: matplotlib.colors.Normalize | str | None = None, cmap_segmentdata: LinearSegmentedColormapType | 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, add_stimulus: bool = False, path_to_image_stimulus: str | None = None, stimulus_origin: str = 'upper') None[source]#

Plot eye gaze trace from positional data.

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

  • position_column (str) – The column name of the x and y position data (default: ‘pixel’)

  • cval (np.ndarray | None) – Line color values. (default: None)

  • cmap (matplotlib.colors.Colormap | None) – Color map for line color values. (default: None)

  • cmap_norm (matplotlib.colors.Normalize | str | None) – Normalization for color values. (default: None)

  • cmap_segmentdata (LinearSegmentedColormapType | None) – Color map segmentation to build color map. (default: None)

  • cbar_label (str | None) – String label for color bar. (default: None)

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

  • padding (float | None) – Absolute padding value. If None it is inferred from pad_factor and limits. (default: None)

  • pad_factor (float | None) – Relative padding factor to construct padding value if not given. (default: 0.5)

  • figsize (tuple[int, int]) – Figure size. (default: (15, 5))

  • title (str | None) – Set figure title. (default: None)

  • savepath (str | None) – If given, figure will be saved to this path. (default: None)

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

  • add_stimulus (bool) – Define whether stimulus should be included. (default: False)

  • path_to_image_stimulus (str | None) – Path to image stimulus. (default: None)

  • stimulus_origin (str) – Origin of stimulus. (default: ‘upper’)

Raises:

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