Skip to content

Commit

Permalink
correctly retrieve idx of bad channels
Browse files Browse the repository at this point in the history
  • Loading branch information
mscheltienne committed Jan 6, 2024
1 parent d00e04c commit 6fad859
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion mne/viz/topo.py
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,15 @@ def _plot_evoked_topo(
if layout is None:
layout = find_layout(info, exclude=exclude)
else:
layout = layout.pick("all", exclude=_picks_to_idx(info, "all", exclude=exclude))
layout = layout.pick(
"all",
exclude=_picks_to_idx(
info,
exclude if exclude != "bads" else info["bads"],
exclude=(),
allow_empty=True,
),
)

if not merge_channels:
# XXX. at the moment we are committed to 1- / 2-sensor-types layouts
Expand Down

0 comments on commit 6fad859

Please sign in to comment.