mne not able to recognize ch_type of channels

:question: If you have a question or issue with MNE-Python, please include the following info:

  • MNE version: 1.6.1
  • operating system: Ubuntu 22.04

I am trying to convert polars dataframe o Raw mne object . But the problem is that , I have 20 electrodes of 10-20 system… When I pass ch_type , the mne raw.plot() changes … Below is code —>

channel_types = ['eeg']*19 + ['ecg']
sfreq = 200 
info = mne.create_info(ch_names = eeg.columns, sfreq = sfreq , ch_types=channel_types)
mne.rename_channels(info,mapping= {'EKG' : 'ECG'})
raw = mne.io.RawArray(eeg.transpose(), info)

But if I don’t pass the ch_types to create_info , it could not recognize ch_types of channel_names by itself…

Below i attach how the raw.plot() looks like in both cases:


My question is why the plot changes by passing the ch_types to create_info ??

Moreover, raw.plot() just gives the image, not an interactive window , I feel that I am missing something…
Pls help

Here is the documentation for create_info. the ch_types parameter has a default value of 'misc', so If you don’t pass any ch_types, the function will assume that all channels are of type misc. This probably isn’t helpful for your case, so please do pass in your ch_types.

This is because MNE automatically scales the traces according to their channel type. The the scalings for misc channels don’t work well for your data, which are EEG channels. Alternatively you could have done raw.plot(scalings="auto"), and MNE would have tried to automatically scale the traces to be visible on the plot.

There are a couple of ways to address this. I’d recommend trying to install mne-qt-browser, and following the usage instructions. Then, you should be able to get a nice interactive plot.

1 Like