diff --git a/mne/viz/_figure.py b/mne/viz/_figure.py index b63d2a395e2..22f3a5f548b 100644 --- a/mne/viz/_figure.py +++ b/mne/viz/_figure.py @@ -424,7 +424,7 @@ def _redraw(self, update_data=True, annotations=False): if annotations and not self.mne.is_epochs: self._draw_annotations() - def _close(self, event): + def _close(self, event=None): """Handle close events (via keypress or window [x]).""" from matplotlib.pyplot import close diff --git a/mne/viz/_mpl_figure.py b/mne/viz/_mpl_figure.py index 2e552bd4012..2f6c64b5a2c 100644 --- a/mne/viz/_mpl_figure.py +++ b/mne/viz/_mpl_figure.py @@ -186,7 +186,7 @@ def _inch_to_rel(self, dim_inches, horiz=True): class MNEAnnotationFigure(MNEFigure): """Interactive dialog figure for annotations.""" - def _close(self, event): + def _close(self, event=None): """Handle close events (via keypress or window [x]).""" parent = self.mne.parent_fig # disable span selector @@ -275,7 +275,7 @@ def _set_active_button(self, idx, *, draw=True): class MNESelectionFigure(MNEFigure): """Interactive dialog figure for channel selections.""" - def _close(self, event): + def _close(self, event=None): """Handle close events.""" self.mne.parent_fig.mne.child_figs.remove(self) self.mne.fig_selection = None