pop_erpimage#

pop_erpimage(EEG=None, typeplot=1, channel=None, projchan=None, titleplot='', smooth=None, decimate=None, sortingtype=None, sortingwin=None, sortingeventfield='', *options, gui=None, renderer=None, plot='on', target=None, rng=None, lastcom='', return_com=False, **kwargs)#

EEGLAB-style pop_erpimage: an event-related potential (ERP) image of a channel or component.

Single trials are stacked as rows, sorted by an event value and smoothed across trials, with the ERP underneath. Remaining positional arguments are erpimage() options as EEGLAB tokens, which can follow only after all ten positional arguments ('phasesort', [0, 25, 10]); keyword options work anywhere (phasesort=[0, 25, 10]). Unlike a bare erpimage call (and EEGLAB’s command line), the ERP trace, the colorbar and the scalp map are on by default.

Without channel (or with gui=True) the dialog opens, filled with the given arguments and options; its values then replace them. Options no dialog field can show (for example topo with its own channel locations) are applied as given.

Parameters:
  • EEG (dict[str, Any] | None) – epoched dataset with more than one trial.

  • typeplot (int) – 1 for channels, 0 for independent component analysis (ICA) components.

  • channel (Any) – 1-based channel numbers, ranges or labels (several are averaged), or component numbers.

  • projchan (Any) – channels to back-project the components onto (ignored for channels).

  • titleplot (str) – figure title; EEGLAB’s default title when empty.

  • smooth (Any) – moving-average width in trials; 5 by default, and the dialog starts at the number of trials minus 5, kept between 0 and 10.

  • decimate (Any) – window advance in trials; 0 by default, 1 in the dialog.

  • sortingtype (Any) – event types to sort by; a string is one type.

  • sortingwin (Any) – [start end] event window in ms.

  • sortingeventfield (str) – event field to sort by, for example 'latency'.

  • *options (Any) – EEGLAB-style erpimage tokens.

  • gui (bool | None) – open the dialog; defaults to an empty channel.

  • renderer (Any | None) – dialog renderer used instead of the Qt dialog.

  • plot (str | bool) – 'off' builds the figure without displaying it.

  • target (Any) – Matplotlib Figure or SubFigure to draw into.

  • rng (Any) – seed or NumPy random generator for the coherence bootstrap and the erpalpha permutations; only an integer seed is written to the history command.

  • lastcom (str) – an earlier pop_erpimage history command, as EEGLAB’s lastcom. Its arguments, options and integer seed fill the dialog (or are replayed with gui=False); the typeplot argument wins over the one in the command.

  • return_com (bool) – also return the Python history command.

  • **kwargs (Any) – erpimage keyword options, plus plotmap (True/False, 'on'/'off' or 1/0) for the scalp map.

Returns:

The ErpimageResult, or (result, command) with return_com=True; None (or (None, "")) when the dialog is cancelled.

Raises:

ValueError – the dataset or a selection cannot be used, an erpimage option landed in projchan or titleplot, lastcom is not a pop_erpimage command or comes with other arguments, no epoch has a matching sorting event, or a dialog entry is invalid.

Return type:

ErpimageResult | tuple[ErpimageResult | None, str] | None