Skip to content

Commit 8df70ae

Browse files
Fix: nearly invisible traces with spatial_colors=True (#13286)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent ed69487 commit 8df70ae

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

doc/changes/devel/13286.bugfix.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fixed almost-white (barely visible) channel traces when using
2+
``spatial_colors=True`` in :meth:`mne.io.Raw.plot_psd`,
3+
:meth:`mne.Epochs.plot_psd`, and related PSD-plot helpers, by :newcontrib:`Mojackhak`.

doc/changes/names.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@
206206
.. _Milan Rybář: https://milanrybar.cz
207207
.. _Mingjian He: https://github.com/mh105
208208
.. _Mohammad Daneshzand: https://github.com/mdaneshzand
209+
.. _Mojackhak: https://github.com/Mojackhak
209210
.. _Moritz Gerster: https://github.com/moritz-gerster
210211
.. _Motofumi Fushimi: https://github.com/motofumi-fushimi/motofumi-fushimi.github.io
211212
.. _Nabil Alibou: https://github.com/nabilalibou

mne/viz/evoked.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@ def _rgb(x, y, z):
226226
rgb = np.array([x, y, z]).T
227227
rgb -= np.nanmin(rgb, 0)
228228
rgb /= np.maximum(np.nanmax(rgb, 0), 1e-16) # avoid div by zero
229+
# Reduce RGB intensity for overly light colors
230+
rgb[rgb.sum(axis=1) > 2.5] = rgb[rgb.sum(axis=1) > 2.5] - 0.3
229231
return rgb
230232

231233

tutorials/evoked/20_visualize_evoked.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# Copyright the MNE-Python contributors.
1717

1818
# %%
19-
19+
# test
2020
import numpy as np
2121

2222
import mne

0 commit comments

Comments
 (0)