Skip to content

Conversation

@mistraube
Copy link
Contributor

@mistraube mistraube commented Nov 8, 2025

Reference issue (if any)

Fixes #13271.

What does this implement/fix?

Fix a regression with mne.viz.plot_evoked() when using gfp="only" or gfp=True.

Plots based on: https://mne.tools/stable/auto_tutorials/evoked/30_eeg_erp.html#sphx-glr-auto-tutorials-evoked-30-eeg-erp-py

l_aud.plot(gfp="only")

Before:
gfp_before
After:
gfp_after

l_aud.plot(gfp=True, spatial_colors=True, ylim=dict(eeg=[-12, 12]))

Before:
evoked_before
After:
evoked_after

Additional information

I tried to identify any other plotting code that might be negatively affected by this change, but I didn't find any.

@larsoner
Copy link
Member

Hmmm in your first plot there is a gap at the bottom, ideally the ylim would start at zero since GFP must be non-negative...

I think in the non-GFP-only case we must do something to set the ylim properly. What is it? Could we extend that logic instead, setting the ylim manually in the GFP-only case? That seems like maybe better/more consistent behavior. Maybe something like ylim = (0, (1.1 * np.max(gfp)) or 1) or similar would work...

@mistraube
Copy link
Contributor Author

Ok, then actually the behavior before this issue was introduced was already not correct. It also has the gap in the gfp-only case. See: https://mne.tools/1.5/auto_tutorials/evoked/30_eeg_erp.html#sphx-glr-auto-tutorials-evoked-30-eeg-erp-py

I'll look into it again.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ylims broken for evoked.plot(gfp='only')

2 participants