Closed
Description
I’ve also encountered the same issue (#6686) with almost white colors when using spatial_colors=True in mne==1.9.0.
As pointed out by bboyth on the MNE Discourse, modifying the _rgb function in
.../env/lib/site-packages/mne/viz/evoked.py helped resolve the issue for me too.
Here’s the modified version of _rgb that worked:
def _rgb(x, y, z):
"""Transform x, y, z values into RGB colors."""
rgb = np.array([x, y, z]).T
rgb -= np.nanmin(rgb, 0)
rgb /= np.maximum(np.nanmax(rgb, 0), 1e-16) # avoid div by zero
# Modification to avoid invisible colors:
# Reduce RGB intensity for overly light colors
rgb[rgb.sum(axis=1) > 2.5] = rgb[rgb.sum(axis=1) > 2.5] - 0.3
return rgb
Would it be possible to consider integrating this fix (or a similar safeguard) into a future release?

Metadata
Metadata
Assignees
Labels
No labels