mne-python icon indicating copy to clipboard operation
mne-python copied to clipboard

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

Open Fayed-Rsl opened this issue 1 year ago • 2 comments

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!

Fayed-Rsl avatar Jun 11 '24 16:06 Fayed-Rsl

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

welcome[bot] avatar Jun 11 '24 16:06 welcome[bot]

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.

drammock avatar Jun 17 '24 22:06 drammock