iām trying to manually annotate parts of my data that are noisy. iām importing my data and am going in interactive annotations as per the tutorial:
From the code snippet, fig3.fake_keypress('a') is used in the tutorial to demonstrate the functionality.
In practice, you have to press on the A key of your keyboard to display the annotation menu. In an interactive python shell, after raw.plot(), the figure will open (using the old matplotlib backend if you donāt have mne-qt-browser installed, using the modern qt backend if you have it), and then you need to press on the A key of your keyboard and it will display the annotation menu.
Next step is to create an annotation by adding a description and finally mark the segments by click/drag on the traces.
Thanks for the reply. Yes, i should have taken this bit out. I do actually press the āaā key once the figure comes up and go into annotation mode where i click and drag to create the annotations. However the first error doesnāt come until i click on the X to close the figure (from annotation mode) and the second error comes up when i try to click on āedit descriptionā from the annotation menu. Itās ok to āadd descriptionā, but not to edit one.
From the text description, nothing that could explain this behavior comes to mind.
If possible, you could join the next Office Hours on January 6th (every 2 weeks usually) and share your screen on Discord.
based on the error messages it sounds like the errors are coming from mne-qt-browser. I donāt know much about DataSpell, but if itās capturing the plot into a panel of its UI that could be part of the issue. You could try using the matplotlib browser backend instead: add mne.viz.set_browser_backend('matplotlib') somewhere early in your script (before any calls to raw.plot()). Thereās a chance that the matplotlib backend will integrate better with DataSpell.
Another option is running the script from a terminal instead of through your IDE; that can help us track down the source of the error too. So in a terminal, running something like ipython -i my_script.py (without making the browser_backend change suggested above) could also be informative.
Thanks for your message. I tried to set the backend to matplotlib in which case the visualisation just didnāt show up. I wasnāt able to run my code via the terminal, because my packages are installed on conda virtual environment and my computer didnāt know how to find them and i didnāt know how to explain it via the terminal. However, i really donāt know whatās changed, since i didnāt do any work over the holidays, but the qt gui is now not crashing when i add a new annotation. Sorry i couldnāt help you find the source of the problem, but iām happy the problem is gone.