mne-tools / mne-python

MNE: Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python
https://mne.tools
BSD 3-Clause "New" or "Revised" License
2.66k stars 1.31k forks source link

Add the possibility to provide custom color mapping for channels in raw.plot() #12658

Open Fayed-Rsl opened 2 months ago

Fayed-Rsl commented 2 months ago

Describe the new feature or enhancement

Hello, I think that it would be nice to have the possibility to have a custom color mapping control based on the provided channel names, because it doesn't seems to be possible so far. Please correct me if I am wrong.

Here is an example of a default raw.plot() image

And for example I would like to plot every SFG channel into red, and MFG into green.

Describe your proposed implementation

One way would be to provide a dict in the color arg*, the key of the dict should be the channel name and the value should be the desired color.

color = {'SFG, Left':'red',  'SFG, Right':'red',  'MFG, Left':'green', 'MFG, Right':'green'}
raw.plot(color=color) 

Describe possible alternatives

One of the possible alternative would be to change colors for specific channel would be to change the ch_types of the desired ch_names. basically assigning SFG to EMG types, MFG to EEG and so on, but it's not really convenient.

Additional context

Thank you!

welcome[bot] commented 2 months ago

Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴

drammock commented 2 months ago

seems like a reasonable feature request. Are you interested in implementing it yourself? As a purely aesthetic change it might be a bit before it reaches the top of our core devs' priority queues.