Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions mne/io/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1911,6 +1911,7 @@ def plot(
color=None,
bad_color="lightgray",
event_color="cyan",
annotation_regex=".*",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
annotation_regex=".*",
*,
annotation_regex=".*",

scalings=None,
remove_dc=True,
order=None,
Expand Down Expand Up @@ -1951,6 +1952,7 @@ def plot(
color,
bad_color,
event_color,
annotation_regex,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and everything afterward should be passed as keywords like annotation_regex=annotation_regex,

scalings,
remove_dc,
order,
Expand Down
6 changes: 5 additions & 1 deletion mne/viz/_figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import importlib
import inspect
import re
from abc import ABC, abstractmethod
from collections import OrderedDict
from contextlib import contextmanager
Expand Down Expand Up @@ -182,7 +183,10 @@ def _setup_annotation_colors(self):
segment_colors[key] = next(color_cycle)
self.mne.annotation_segment_colors = segment_colors
# init a couple other annotation-related variables
self.mne.visible_annotations = {label: True for label in labels}
annot_regex = re.compile(self.mne.annotation_regex)
self.mne.visible_annotations = {
l: True if annot_regex.match(l) else False for l in labels
}
self.mne.show_hide_annotation_checkboxes = None

def _update_annotation_segments(self):
Expand Down
2 changes: 2 additions & 0 deletions mne/viz/raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def plot_raw(
color=None,
bad_color="lightgray",
event_color="cyan",
annotation_regex=".*",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're going to add it here (which is reasonable) we need to make everything kwarg-only (which we've been doing to functions bit-by-bit)

Suggested change
annotation_regex=".*",
*,
annotation_regex=".*",

scalings=None,
remove_dc=True,
order=None,
Expand Down Expand Up @@ -373,6 +374,7 @@ def plot_raw(
event_times=event_times,
event_nums=event_nums,
event_id_rev=event_id_rev,
annotation_regex=annotation_regex,
# preprocessing
projs=projs,
projs_on=projs_on,
Expand Down
Loading