mne_denoise.viz.plot_tradeoff_scatter#

mne_denoise.viz.plot_tradeoff_scatter(data, x_col, y_col, group_col='group', group_order=None, group_colors=None, group_labels=None, x_label=None, y_label=None, title='Metric Trade-off', reference_x=None, reference_y=None, ax=None, fname=None, show=True)[source]#

Plot a grouped x/y trade-off scatter with optional group means.

Parameters:
  • data (mapping of str to array-like) – Columnar mapping with group and metric columns.

  • x_col (str) – Metric columns for x and y axes.

  • y_col (str) – Metric columns for x and y axes.

  • group_col (str) – Grouping column name.

  • group_order (list of str | None) – Optional group order. If None, first-seen order is used.

  • group_colors (dict | None) – Optional style overrides keyed by group name.

  • group_labels (dict | None) – Optional style overrides keyed by group name.

  • x_label (str | None) – Axis labels. If None, derived from metric names.

  • y_label (str | None) – Axis labels. If None, derived from metric names.

  • title (str) – Axes title.

  • reference_x (float | None) – Optional vertical/horizontal reference lines.

  • reference_y (float | None) – Optional vertical/horizontal reference lines.

  • ax (matplotlib.axes.Axes | None) – Existing axes. If None, create a new figure.

  • fname (path-like | None) – Optional output path when creating a new figure.

  • show (bool) – Whether to display the figure when creating a new figure.

Returns:

fig – Figure handle.

Return type:

matplotlib.figure.Figure

Examples

>>> import numpy as np
>>> from mne_denoise.viz import plot_tradeoff_scatter
>>> data = {
...     "group": np.array(["A", "A", "B", "B"]),
...     "distortion": np.array([0.1, 0.2, 0.4, 0.3]),
...     "attenuation": np.array([8.0, 9.0, 5.0, 6.0]),
... }
>>> fig = plot_tradeoff_scatter(
...     data, group_col="group", x_col="distortion", y_col="attenuation", show=False
... )