Skip to content

plot_evoked(gfp=True) with single-channel data behaves incorrectly #8772

Description

@hoechenberger

Problem

Plotting the GFP of data with only a single sensor via plot_evoked(gfp=True) produces a GFP, although the GFP – describing the spatial standard deviation – should not exist.

Steps to reproduce

import os
import mne
sample_data_folder = mne.datasets.sample.data_path()
sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',
                                    'sample_audvis_raw.fif')
raw = mne.io.read_raw_fif(sample_data_raw_file, verbose=False)
events = mne.find_events(raw, stim_channel='STI 014')
event_dict = {'auditory/left': 1, 'auditory/right': 2, 'visual/left': 3,
              'visual/right': 4}
epochs = mne.Epochs(raw, events, tmin=-0.3, tmax=0.7, event_id=event_dict,
                    preload=True)
evoked = epochs['auditory/left'].average()

evoked.pick('EEG 001').plot(gfp=True)

Expected results

  • either no GFP trace, or
  • a GFP constantly at zero, or
  • a warning, or
  • an error message

Actual results

GFP is displayed as the absolute value of the sensor signal.
Screen Shot 2021-01-22 at 16 27 48

Additional information

Using master.

Activity

  1. added 2 commits that reference this issue on Jan 22, 2021
    5bcf57a
    ef1b686
  2. added a commit that references this issue on Jan 23, 2021
    ae8a466
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions