Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changes/dev/13481.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug with :func:`mne.viz.plot_evoked` when using ``gfp="only"`` or ``gfp=True``, by `Michael Straube`_.
2 changes: 2 additions & 0 deletions mne/viz/evoked.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,10 +727,12 @@ def _plot_lines(
)
if gfp_only:
y_offset = 0.0
this_ylim = (0, 1.1 * np.max(this_gfp) or 1)
else:
y_offset = this_ylim[0]
this_gfp += y_offset
ax.autoscale(False)
ax.set_ylim(this_ylim)
ax.fill_between(
times,
y_offset,
Expand Down
4 changes: 2 additions & 2 deletions tutorials/evoked/30_eeg_erp.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@
evk.plot(gfp=True, spatial_colors=True, ylim=dict(eeg=[-12, 12]))

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

l_aud.plot(gfp="only")

Expand Down