# Annotation Plot Error

**URL:** <https://mne.discourse.group/t/annotation-plot-error/5340>\
**Category:** Support & Discussions\
**Tags:** preprocessing, eeg\
**Created:** [July 28, 2022, 2:57am UTC](https://mne.discourse.group/t/annotation-plot-error/5340 "2022-07-28T02:57:05Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/matt/32/2960_2.png) [@Matt](https://mne.discourse.group/u/Matt)\
**Post date:** [July 28, 2022, 2:57am UTC](https://mne.discourse.group/t/annotation-plot-error/5340/1 "2022-07-28T02:57:05Z")

</div>

- MNE version: 1.0.3
- operating system: Windows 10

Hello all,

I have been running into an issue with the annotation of the plot. After I raw.plot() and press “a” to get the annotation menu. If I click “Add Description” if completely freezes the plot permanently. The only way to stop it is to go into task manager. I have been trying to add a “BAD” description to cut out a bad portion of data, but whenever I try I freeze the program. I would like to add that MNE and spyder still function fine, but all plots that have been made are frozen. And yes, I am plotting in a separate window from spyder if that is a possible source of the issue.  
Has any one else seen this and is their a way around it.

as a side note I have also found that the plot itself seems backwards in color. With the offset of raw.plot(bgcolor=‘w’, color=‘k’) I get a black background with white traces. If I type in the opposite raw.plot(bgcolor=‘k’, color=‘w’) I get a white background with black traces.

Best,  
Matt

---

<div class="post-metadata">

**Author:** ![Dannapnt1](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/dannapnt1/32/2161_2.png) [@Dannapnt1](https://mne.discourse.group/u/Dannapnt1)\
**Post date:** [January 10, 2023, 4:25pm UTC](https://mne.discourse.group/t/annotation-plot-error/5340/2 "2023-01-10T16:25:05Z")

</div>

I have the same problem, have you found a fix for this?

I am working on a mac OS, and the MNE version is 1.3.0

---

<div class="post-metadata">

**Author:** ![Matt](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/matt/32/2960_2.png) [@Matt](https://mne.discourse.group/u/Matt)\
**Post date:** [January 10, 2023, 8:50pm UTC](https://mne.discourse.group/t/annotation-plot-error/5340/3 "2023-01-10T20:50:46Z")

</div>

Hi @Dannapnt1, unfortunately no, I have not found a solution. I just found a different way to preprocess the data to avoid needing to add annotations.

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [January 10, 2023, 10:06pm UTC](https://mne.discourse.group/t/annotation-plot-error/5340/4 "2023-01-10T22:06:37Z")

</div>

Hello @Dannapnt1, welcome to the forum!

Could you please share the output of:

```python
import mne
mne.sys_info()

```

This may help us narrow down the problem. Also, how do you run your MNE script? From the command line? From a development environment? Which one?

Thanks!

Richard

---

<div class="post-metadata">

**Author:** ![Dannapnt1](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/dannapnt1/32/2161_2.png) [@Dannapnt1](https://mne.discourse.group/u/Dannapnt1)\
**Post date:** [January 15, 2023, 8:47am UTC](https://mne.discourse.group/t/annotation-plot-error/5340/5 "2023-01-15T08:47:10Z")

</div>

> [@richard](#):
>
> Could

Hi @richard I am running this on the Spyder development environment. This is the output

Platform: macOS-10.16-x86\_64-i386-64bit  
Python: 3.8.15 | packaged by conda-forge | (default, Nov 22 2022, 08:53:40) [Clang 14.0.6]  
Executable: /Users/dannapinto1/opt/anaconda3/envs/mne/bin/python  
CPU: i386: 4 cores  
Memory: 8.0 GB

mne: 1.3.0  
numpy: 1.23.5 {OpenBLAS 0.3.21 with 4 threads}  
scipy: 1.10.0  
matplotlib: 3.6.2 {backend=Qt5Agg}

sklearn: 1.2.0  
numba: 0.56.4  
nibabel: 4.0.2  
nilearn: 0.10.0  
dipy: 1.5.0  
openmeeg: 2.5.5  
cupy: Not found  
pandas: 1.5.2  
pyvista: 0.37.0 {OpenGL 4.1 INTEL-18.8.5 via Intel(R) Iris™ Graphics 6100}  
pyvistaqt: 0.9.0  
ipyvtklink: 0.2.3  
vtk: 9.2.5  
qtpy: 2.3.0 {PyQt5=5.15.6}  
ipympl: Not found  
pyqtgraph: 0.13.1  
pooch: v1.6.0

mne\_bids: Not found  
mne\_nirs: Not found  
mne\_features: Not found  
mne\_qt\_browser: 0.4.0  
mne\_connectivity: Not found  
mne\_icalabel: Not found

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [January 15, 2023, 6:33pm UTC](https://mne.discourse.group/t/annotation-plot-error/5340/6 "2023-01-15T18:33:39Z")

</div>

> [@Matt](#):
>
> as a side note I have also found that the plot itself seems backwards in color. With the offset of raw.plot(bgcolor=‘w’, color=‘k’) I get a black background with white traces. If I type in the opposite raw.plot(bgcolor=‘k’, color=‘w’) I get a white background with black traces.

I cannot reproduce this with MNE-Python 1.3.0 with the mne-qt-browser backend on macOS:

```python
# %%
import mne

sample_dir = mne.datasets.sample.data_path()
sample_fname = sample_dir / 'MEG' / 'sample' / 'sample_audvis_raw.fif'

raw = mne.io.read_raw_fif(sample_fname, preload=True)
raw.crop(tmax=60)

with mne.viz.use_browser_backend('qt'):
    raw.plot(bgcolor='k', color='w')

```

produces a figure with black background an white traces.

 ![Screenshot 2023-01-15 at 19.31.36](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/4/4dd3574ae4c3bce23414690267b8e914e3b57f70.png)

Regarding the problem with the qt-browser backend when running from Spyder, maybe @marsipu has an idea?

Best wishes,  
Richard

---

<div class="post-metadata">

**Author:** ![marsipu](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/marsipu/32/196_2.png) [@marsipu](https://mne.discourse.group/u/marsipu)\
**Post date:** [January 16, 2023, 8:17pm UTC](https://mne.discourse.group/t/annotation-plot-error/5340/7 "2023-01-16T20:17:09Z")

</div>

I don’t really have an idea for a solution. I just remembered another [Spyder-related issue](https://github.com/mne-tools/mne-qt-browser/issues/134), that was solely appearing when starting from a spyder-console. It was resolved over time by unknown cause. @Dannapnt1 Are you running on the latest spyder-kernels?

---

<div class="post-metadata">

**Author:** ![Matt](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/matt/32/2960_2.png) [@Matt](https://mne.discourse.group/u/Matt)\
**Post date:** [January 16, 2023, 8:49pm UTC](https://mne.discourse.group/t/annotation-plot-error/5340/8 "2023-01-16T20:49:23Z")

</div>

Hi @richard, Yes, I believe this particular issue with the coloring of the plots is due to one of the spyder preferences for dark mode, particularly for the editor being changed in an update. Although the typical color change schemes in preferences in the appearances menu of is still there, but there was another color scheme option in the editor menu of the preferences that controlled plots in separate windows. It seems to have disappeared in newer versions of spyder. I did use the Windows download MNE package, so I figured this might be a problem others are having but it could also just be the alignment of the different anaconda dependencies on my computer. I only get this on my windows machine, my linux cluster does not have this problem.

As for the freezing when I try to annotate and add a new annotation description, that happens for me on both windows and linux.

---

<div class="post-metadata">

**Author:** ![Dannapnt1](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/dannapnt1/32/2161_2.png) [@Dannapnt1](https://mne.discourse.group/u/Dannapnt1)\
**Post date:** [January 16, 2023, 8:51pm UTC](https://mne.discourse.group/t/annotation-plot-error/5340/9 "2023-01-16T20:51:42Z")

</div>

yes, I very recently updated to the most current version. I think I will try to run this from the terminal and see what happens.

---

<div class="post-metadata">

**Author:** ![mscheltienne](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mscheltienne/32/827_2.png) [@mscheltienne](https://mne.discourse.group/u/mscheltienne)\
**Post date:** [January 16, 2023, 9:05pm UTC](https://mne.discourse.group/t/annotation-plot-error/5340/10 "2023-01-16T21:05:17Z")

</div>

Hello,

It’s difficult to debug from the information provided. I use Spyder on all 3 OS, and I can not reproduce the issue.

@marsipu The issue you mentioned was resolved by [remove add/remove objects for view-range by marsipu · Pull Request #139 · mne-tools/mne-qt-browser · GitHub](https://github.com/mne-tools/mne-qt-browser/pull/139)

Mathieu
