From 97bce190e1a9831395ed0c1ebf5365b248e023d3 Mon Sep 17 00:00:00 2001 From: Reza Shoorangiz Date: Fri, 13 May 2022 01:29:31 +1200 Subject: [PATCH] [MRG] Fixed group_by titles in evoked_plot. (#10618) * Fixed group_by titles in evoked_plot. * added contribution info --- doc/changes/latest.inc | 2 ++ mne/viz/evoked.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/changes/latest.inc b/doc/changes/latest.inc index 8b07c4029ac..2c3efb613d7 100644 --- a/doc/changes/latest.inc +++ b/doc/changes/latest.inc @@ -98,6 +98,8 @@ Bugs - Fix issue with saving epochs once :func:`~mne.preprocessing.compute_current_source_density` has been used if a rejection threshold was used first (:gh:`10619` by `Alex Rockhill`_ and `Richard Höchenberger`_) +- Fix bug in :func:`mne.viz.plot_evoked_image` that would cause incorrect sub-titles when using ``group_by`` (:gh:`10618` by `Reza Shoorangiz`_) + API and behavior changes ~~~~~~~~~~~~~~~~~~~~~~~~ - When creating BEM surfaces via :func:`mne.bem.make_watershed_bem` and :func:`mne.bem.make_flash_bem`, the ``copy`` parameter now defaults to ``True``. This means that instead of creating symbolic links inside the FreeSurfer subject's ``bem`` folder, we now create "actual" files. This should avoid troubles when sharing files across different operating systems and file systems (:gh:`10531` by `Richard Höchenberger`_) diff --git a/mne/viz/evoked.py b/mne/viz/evoked.py index 6a8b9da9c78..5ce76a3ccd2 100644 --- a/mne/viz/evoked.py +++ b/mne/viz/evoked.py @@ -236,10 +236,10 @@ def _plot_evoked(evoked, picks, exclude, unit, show, ylim, proj, xlim, hline, "found in `axes`") ax = axes[sel] # the unwieldy dict comp below defaults the title to the sel - titles = ({channel_type(evoked.info, idx): sel - for idx in group_by[sel]} if titles is None else titles) + title = ({channel_type(evoked.info, idx): sel + for idx in group_by[sel]} if titles is None else titles) _plot_evoked(evoked, group_by[sel], exclude, unit, show, ylim, - proj, xlim, hline, units, scalings, titles, + proj, xlim, hline, units, scalings, title, ax, plot_type, cmap=cmap, gfp=gfp, window_title=window_title, selectable=selectable, noise_cov=noise_cov,