Skip to content

mne.viz.plot_source_estimates docs incorrectly say colormap can be supplied as an ndarray #13189

Closed

Description

@caiw

Proposed documentation enhancement

The docs on the website include:

colormap : str | np.ndarray of float, shape(n_colors, 3 | 4)

  • Name of colormap to use or a custom look up table. If array, must be (n x 3) or (n x 4) array for with RGB or RGBA values between 0 and 255. The default (‘auto’) uses 'hot' for one-sided data and ‘mne’ for two-sided data.

But then in _process_clim there is a call to _validate_type(colormap, (str, Colormap), "colormap"), which throws an error if an ndarray is supplied.

Activity

  1. welcome commented on Apr 4, 2025

    @welcome

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

  2. larsoner commented on Apr 4, 2025

    @larsoner
    Member

    I think in this case it's probably best to update the documentation, and maybe somewhere link to ListedColormap to show people how to easily go from an ndarray to a colormap.

    Or we could add support to do this, it would in theory only be a few lines since ListedColormap should do all the sanity checking when passed an ndarray I think...

  3. Dpereaptkhamur-13 commented on Apr 7, 2026

    @Dpereaptkhamur-13
    Contributor

    Hi! I'm a GSoC 2026 applicant. I'd like to fix this documentation discrepancy in plot_source_estimates. May I take this up?

  4. tsbinns commented on Apr 7, 2026

    @tsbinns
    Member

    Hi @Dpereaptkhamur-13, looks like this particular one is already being worked on: #13797.

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