moabb.analysis.plotting.dataset_bubble_plot#

moabb.analysis.plotting.dataset_bubble_plot(dataset=None, center: tuple[float, float] = (0.0, 0.0), scale: float = 0.5, size_mode: Literal['count', 'duration'] = 'count', shape: Literal['circle', 'hexagon'] = 'circle', gap: float = 0.0, color_map: dict[str, Any] | None = None, alphas: Sequence[float] | None = None, title: bool = True, legend: bool = True, legend_position: tuple[float, float] | None = None, fontsize: int = 8, ax=None, dataset_name: str | None = None, paradigm: str | None = None, n_subjects: int | None = None, n_sessions: int | None = None, n_trials: int | None = None, trial_len: float | None = None)[source]#

Plot a bubble plot for a dataset.

Each bubble represents one subject. The size of the bubble is proportional to the number of trials per subject on a log scale, the color represents the paradigm, and the alpha is proportional to the number of sessions.

You may pass a moabb.datasets.base.BaseDataset object via the dataset parameret, and all the characteristics of this dataset will be extracted automatically. Alternatively, if you want to plot a dataset not present in MOABB, you can directly pass the characteristics of the dataset via the dataset_name, paradigm, n_subjects, n_sessions, n_trials, and trial_len parameters. If you pass both the dataset object and some parameters, the parameters passed will override the ones extracted from the dataset object.

Parameters:
  • dataset (Dataset) – Dataset to plot

  • center (tuple[float, float]) – Coordinates of the center of the plot

  • scale (float) – Scaling factor applied to the bubble sizes.

  • size_mode (Literal["count", "duration"]) – Specifies how the size of the bubbles is calculated. Either “count” (number of trials) or “duration” (number of trials times trial duration).

  • shape (Literal["circle", "hexagon"]) – Shape of the bubbles. Either “circle” or “hexagon”.

  • gap (float) – Gap between the bubbles.

  • color_map (dict[str, Any] | None) – Dictionary that maps paradigms to colors. If None, the tab10 color map is used.

  • alphas (Sequence[float] | None) – List of alpha values for the bubbles. If None, a default list is used.

  • title (bool) – Whether to display the dataset title in the center of the plot.

  • legend (bool) – Whether to display the legend.

  • legend_position (tuple[float, float] | None, default=None) – Coordinates of the bottom left corner of the legend. If None, the legend is placed at the bottom right of the plot.

  • fontsize (int) – Font size of the legend text.

  • ax (Axes | None) – Axes to plot on. If None, the default axes are used.

  • dataset_name (str | None) – Name of the dataset. Required if dataset is None.

  • paradigm (str | None) – Paradigm name. Required if dataset is None.

  • n_subjects (int | None) – Number of subjects. Required if dataset is None.

  • n_sessions (int | None) – Number of sessions. Required if dataset is None.

  • n_trials (int | None) – Number of trials per session. Required if dataset is None.

  • trial_len (float | None) – Duration of one trial, in seconds. Required if dataset is None.