Skip to content

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

Closed

Description

@Fayed-Rsl

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!

Activity

  1. welcome commented on Jun 11, 2024

    @welcome

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

  2. drammock commented on Jun 17, 2024

    @drammock
    Member

    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.

  3. HansujaB commented on Mar 15, 2026

    @HansujaB
    Contributor

    Hi @drammock , I would like to work on this feature. I’ll start looking into the implementation and open a PR once I have a working version. Please let me know if there are any suggestions before I begin. Thanks!

  4. HansujaB commented on Mar 18, 2026

    @HansujaB
    Contributor

    Hi @drammock , I have opened a PR for this issue let me know if anything needs to be modified!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions