MNE interactive plots on jupyter inline

  • MNE version: 1.7.1
    Hello, in my lab we are trying to set up a pipeline in mne using a server that is usabel through a jupyterlab interface, so it is not possible to plot on popup windows, but only on the inline.
    After some research I found out that it’s possible to obtain an interactive plot by running the following:
%matplotlib ipympl
mne.viz.set_browser_backend('matplotlib')

After those commands I have plotted the raw data in the inline with:

raw.plot()

Now, I can confirm that the window is actually interactive for the operations of scrolling, zooming and selecting channels (the clicked channels turns gray), but it is not possible, for example to take annotation.
After highlighting some channels I run the following lines:

plt.close('all')
matplotlib.pyplot.close()

Now, my problem is that when i run:

raw.info['bads']

It returns an empty list like I never annotate any channels as bad.
Did someone have the same problem and knows a solution or a workaround for any annotations?
For bad channels I could manually annotate them, but when the operation to carry out is to check epochs, hundreds epochs, the interactive window helps a lot.

raw.info['bads'] gets set when you close the window with the browser. It’s quite possible this functionality does not work in a notebook that does not really have a concept of closing a figure window.