Skip to content

Commit 587c99f

Browse files
mistraubedrammock
andauthored
FIX: Fix regression with mne.viz.plot_evoked (#13481)
Co-authored-by: Daniel McCloy <[email protected]>
1 parent 78887f1 commit 587c99f

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

doc/changes/dev/13481.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix bug with :func:`mne.viz.plot_evoked` when using ``gfp="only"`` or ``gfp=True``, by `Michael Straube`_.

mne/viz/evoked.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,10 +727,12 @@ def _plot_lines(
727727
)
728728
if gfp_only:
729729
y_offset = 0.0
730+
this_ylim = (0, 1.1 * np.max(this_gfp) or 1)
730731
else:
731732
y_offset = this_ylim[0]
732733
this_gfp += y_offset
733734
ax.autoscale(False)
735+
ax.set_ylim(this_ylim)
734736
ax.fill_between(
735737
times,
736738
y_offset,

tutorials/evoked/30_eeg_erp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,8 @@
286286
evk.plot(gfp=True, spatial_colors=True, ylim=dict(eeg=[-12, 12]))
287287

288288
# %%
289-
# To plot the GFP by itself, you can pass ``gfp='only'`` (this makes it easier
290-
# to read off the GFP data values, because the scale is aligned):
289+
# To plot the GFP by itself, you can pass ``gfp='only'`` (this makes it easier to
290+
# read off the GFP data values, because the scale is aligned):
291291

292292
l_aud.plot(gfp="only")
293293

0 commit comments

Comments
 (0)