tsplot#
- pymovements.plotting.tsplot(gaze: Gaze, channels: list[str] | None = None, xlabel: str | None = None, n_cols: int | None = None, n_rows: int | None = None, rotate_ylabels: bool = True, share_y: bool = True, zero_centered_yaxis: bool = True, line_color: tuple[int, int, int] | str = 'k', line_width: int = 1, show_grid: bool = True, show_yticks: bool = True, figsize: tuple[int, int] = (15, 5), title: str | None = None, savepath: str | None = None, show: bool = True, *, ax: Axes | None = None, closefig: bool | None = None) tuple[Figure, Axes][source]#
Plot time series with each channel getting a separate subplot.
- Parameters:
gaze (Gaze) – The Gaze to plot.
channels (list[str] | None) – List of channel names to plot. If None, all channels will be plotted. (default: None)
xlabel (str | None) – Set the x label. (default: None)
n_cols (int | None) – Number of channel subplot columns. If None, it will be inferred. (default: None)
n_rows (int | None) – Number of channel subplot rows. If None, it will be inferred. (default: None)
rotate_ylabels (bool) – Set whether to rotate ylabels. (default: True)
share_y (bool) – Set if y-axes should share a common axis. (default: True)
zero_centered_yaxis (bool) – Set if y-axis should be zero-centered. (default: True)
line_color (tuple[int, int, int] | str) – Set line color. (default: ‘k’)
line_width (int) – Set line width. (default: 1)
show_grid (bool) – Set whether to show the background grid. (default: True)
show_yticks (bool) – Set whether to show yticks. (default: True)
title (str | None) – 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)
ax (plt.Axes | None) – External axes to draw into when plotting a single channel. Ignored when
n_channels > 1. (default: None)closefig (bool | None) – Whether to close the figure. If None, close only when the function created the figure. (default: None)
- Returns:
The created or provided figure and the primary axes (the first subplot).
- Return type:
tuple[plt.Figure, plt.Axes]
- Raises:
ValueError – If array has more than two dimensions.