# possible problem with raw.plot()

**URL:** <https://mne.discourse.group/t/possible-problem-with-raw-plot/2286>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [August 12, 2020, 4:50pm UTC](https://mne.discourse.group/t/possible-problem-with-raw-plot/2286 "2020-08-12T16:50:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [August 12, 2020, 4:50pm UTC](https://mne.discourse.group/t/possible-problem-with-raw-plot/2286/1 "2020-08-12T16:50:21Z")

</div>

External Email - Use Caution

I am getting an error when using raw.plot with either fif or edf files. Sample code and output below. Is this a bug or am I missing something? FWIW I get the same error with python 3.8.5

Sample code (shortened from [https://mne.tools/stable/auto\_examples/io/plot\_read\_and\_write\_raw\_data.html#sphx-glr-auto-examples-io-plot-read-and-write-raw-data-py](https://mne.tools/stable/auto_examples/io/plot_read_and_write_raw_data.html#sphx-glr-auto-examples-io-plot-read-and-write-raw-data-py)):  
import matplotlib.pyplot as plt  
import mne  
from mne.datasets import sample

data\_path = sample.data\_path()  
fname = data\_path + '/MEG/sample/sample\_audvis\_raw.fif'  
raw = mne.io.read\_raw\_fif(fname)

print(mne.sys\_info())  
raw.plot()  
plt.show()

Output:  
Opening raw data file C:\Users\leisenman\mne\_data\MNE-sample-data/MEG/sample/sample\_audvis\_raw.fif...  
&nbsp;&nbsp;&nbsp;&nbsp;Read a total of 3 projection items:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PCA-v1 (1 x 102) idle  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PCA-v2 (1 x 102) idle  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PCA-v3 (1 x 102) idle  
&nbsp;&nbsp;&nbsp;&nbsp;Range : 25800 ... 192599 = 42.956 ... 320.670 secs  
Ready.  
Current compensation grade : 0  
Platform: Windows-10-10.0.10240-SP0  
Python: 3.7.8 | packaged by conda-forge | (default, Jul 31 2020, 01:53:57) [MSC v.1916 64 bit (AMD64)]  
Executable: C:\Users\leisenman\AppData\Local\Continuum\miniconda3\envs\mne7\python.exe  
CPU: Intel64 Family 6 Model 142 Stepping 9, GenuineIntel: 4 cores  
Memory: 7.7 GB

mne: 0.20.7  
numpy: 1.19.1 {blas=blas, lapack=blas}  
scipy: 1.5.0  
matplotlib: 3.3.0 {backend=Qt5Agg}

sklearn: 0.23.2  
numba: 0.50.1  
nibabel: 3.1.1  
cupy: Not found  
pandas: 1.1.0  
dipy: 1.1.0  
mayavi: 4.7.1 {qt\_api=pyqt5, PyQt5=5.12.3}  
pyvista: 0.25.3  
vtk: 8.2.0  
None  
Traceback (most recent call last):  
&nbsp;&nbsp;File "c:\Users\leisenman\Box\Python\testedf\test\_mne\_raw.py", line 33, in \<module\>  
&nbsp;&nbsp;&nbsp;&nbsp;raw.plot()  
&nbsp;&nbsp;File "C:\Users\leisenman\AppData\Local\Continuum\miniconda3\envs\mne7\lib\site-packages\mne\io\base.py", line 1378, in plot  
&nbsp;&nbsp;&nbsp;&nbsp;show\_scalebars=show\_scalebars, verbose=verbose)  
&nbsp;&nbsp;File "\<decorator-gen-138\>", line 21, in plot\_raw  
&nbsp;&nbsp;File "C:\Users\leisenman\AppData\Local\Continuum\miniconda3\envs\mne7\lib\site-packages\mne\viz\raw.py", line 415, in plot\_raw  
&nbsp;&nbsp;&nbsp;&nbsp;n\_channels)  
&nbsp;&nbsp;File "C:\Users\leisenman\AppData\Local\Continuum\miniconda3\envs\mne7\lib\site-packages\mne\viz\raw.py", line 722, in \_prepare\_mne\_browse\_raw  
&nbsp;&nbsp;&nbsp;&nbsp;ax.set\_yticklabels(['X' \* max([len(ch) for ch in info['ch\_names']])])  
&nbsp;&nbsp;File "C:\Users\leisenman\AppData\Local\Continuum\miniconda3\envs\mne7\lib\site-packages\matplotlib\axes\_base.py", line 63, in wrapper  
&nbsp;&nbsp;&nbsp;&nbsp;return get\_method(self)(\*args, \*\*kwargs)  
&nbsp;&nbsp;File "C:\Users\leisenman\AppData\Local\Continuum\miniconda3\envs\mne7\lib\site-packages\matplotlib\cbook\deprecation.py", line 451, in wrapper  
&nbsp;&nbsp;&nbsp;&nbsp;return func(\*args, \*\*kwargs)  
&nbsp;&nbsp;File "C:\Users\leisenman\AppData\Local\Continuum\miniconda3\envs\mne7\lib\site-packages\matplotlib\axis.py", line 1793, in \_set\_ticklabels  
&nbsp;&nbsp;&nbsp;&nbsp;return self.set\_ticklabels(labels, minor=minor, \*\*kwargs)  
&nbsp;&nbsp;File "C:\Users\leisenman\AppData\Local\Continuum\miniconda3\envs\mne7\lib\site-packages\matplotlib\axis.py", line 1715, in set\_ticklabels  
&nbsp;&nbsp;&nbsp;&nbsp;"The number of FixedLocator locations"  
ValueError: The number of FixedLocator locations (20), usually from a call to set\_ticks, does not match the number of ticklabels (1).

Larry

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [August 12, 2020, 5:33pm UTC](https://mne.discourse.group/t/possible-problem-with-raw-plot/2286/2 "2020-08-12T17:33:23Z")

</div>

External Email - Use Caution

This is indeed a bug, it has been fixed in the development branch of MNE  
and will be part of the next release (scheduled for middle of September).

Eric
