From 17b7a157fa05cd5f89fd2ea7fb332893a3094d50 Mon Sep 17 00:00:00 2001 From: Daniel McCloy Date: Mon, 5 Apr 2021 16:34:42 -0500 Subject: [PATCH 1/3] fix comparing array to string --- mne/viz/evoked.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mne/viz/evoked.py b/mne/viz/evoked.py index 0f710232d58..f275829fd62 100644 --- a/mne/viz/evoked.py +++ b/mne/viz/evoked.py @@ -2251,7 +2251,8 @@ def plot_compare_evokeds(evokeds, picks=None, colors=None, warn('Only {} channel in "picks"; cannot combine by method "{}".' .format(len(picks), combine)) # `combine` defaults to GFP unless picked a single channel or axes='topo' - if combine is None and len(picks) > 1 and axes != 'topo': + do_topo = isinstance(axes, str) and axes == 'topo' + if combine is None and len(picks) > 1 and not do_topo: combine = 'gfp' # convert `combine` into callable (if None or str) combine_func = _make_combine_callable(combine) @@ -2261,7 +2262,6 @@ def plot_compare_evokeds(evokeds, picks=None, colors=None, ch_names=ch_names, combine=combine) # setup axes - do_topo = (axes == 'topo') if do_topo: show_sensors = False if len(picks) > 70: From fc14935e5afc7920abf3de48af868b2558a97ddc Mon Sep 17 00:00:00 2001 From: Daniel McCloy Date: Mon, 5 Apr 2021 16:40:37 -0500 Subject: [PATCH 2/3] update changelog --- doc/changes/latest.inc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/changes/latest.inc b/doc/changes/latest.inc index 9a60e9def0c..5b52feb1248 100644 --- a/doc/changes/latest.inc +++ b/doc/changes/latest.inc @@ -272,6 +272,8 @@ Bugs - Fix bug with :func:`mne.io.Raw.pick` where incorrect fnirs types were returned (:gh:`9178` by `Robert Luke`_) +- Fix bug when passing both axes and picks to `mne.viz.plot_compare_evokeds` (:gh:`9252` by `Daniel McCloy`_) + - Improved string representation of `~mne.Epochs` containing multiple event types; improved (and more mathematically correct) ``evoked.comment`` in the `mne.combine_evoked` output; and better (and often more concise) legend labels in the figures created via `~mne.viz.plot_compare_evokeds` (:gh:`9027` by `Richard Höchenberger`_) - :func:`mne.preprocessing.find_ecg_events` now correctly handles situation where no ECG activity could be detected, and correctly returns an empty array of ECG events (:gh:`9236` by `Richard Höchenberger`_) From bca866c57e77f5f5ba1ad8fd862cc66e5bdd4ee7 Mon Sep 17 00:00:00 2001 From: Daniel McCloy Date: Mon, 5 Apr 2021 16:41:11 -0500 Subject: [PATCH 3/3] fix: prev changelog entry in wrong place --- doc/changes/latest.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/changes/latest.inc b/doc/changes/latest.inc index 5b52feb1248..1caefe053c0 100644 --- a/doc/changes/latest.inc +++ b/doc/changes/latest.inc @@ -280,10 +280,10 @@ Bugs API changes ~~~~~~~~~~~ -- `mne.viz.plot_sensors_connectivity` now allows setting the colorbar label via the ``cbar_label`` parameter (:gh:`9248` by `Daniel McCloy`_) - - Introduced new ``'auto'`` settings for ``ICA.max_iter``. The old default ``max_iter=200`` will be removed in MNE-Python 0.24 (:gh:`9099` **by new contributor** |Cora Kim|_) +- `mne.viz.plot_sensors_connectivity` now allows setting the colorbar label via the ``cbar_label`` parameter (:gh:`9248` by `Daniel McCloy`_) + - ``mne.read_selection`` has been deprecated in favor of `mne.read_vectorview_selection`. ``mne.read_selection`` will be removed in MNE-Python 0.24 (:gh:`8870` by `Richard Höchenberger`_) - ``mne.beamformer.tf_dics`` has been deprecated and will be removed in MNE-Python 0.24 (:gh:`9122` by `Britta Westner`_)