mne.viz.plot_ica_sources#
- mne.viz.plot_ica_sources(ica, inst, picks=None, start=None, stop=None, title=None, show=True, block=False, show_first_samp=False, show_scrollbars=True, time_format='float', precompute=None, use_opengl=None, *, theme=None)[source]#
Plot estimated latent sources given the unmixing matrix.
Typical usecases:
plot evolution of latent sources over time based on (Raw input)
plot latent source around event related time windows (Epochs input)
plot time-locking in ICA space (Evoked input)
- Parameters
- icainstance of
mne.preprocessing.ICA The ICA solution.
- instinstance of
mne.io.Raw,mne.Epochs,mne.Evoked The object to plot the sources from.
- picks
str|list|slice|None Channels to include. Slices and lists of integers will be interpreted as channel indices. In lists, channel type strings (e.g.,
['meg', 'eeg']) will pick channels of those types, channel name strings (e.g.,['MEG0111', 'MEG2623']will pick the given channels. Can also be the string values “all” to pick all channels, or “data” to pick data channels. None (default) will pick all sources in the order as fitted.- start, stop
float|int|None If
instis aRawor anEvokedobject, the first and last time point (in seconds) of the data to plot. Ifinstis aRawobject,start=Noneandstop=Nonewill be translated intostart=0.andstop=3., respectively. ForEvoked,Nonerefers to the beginning and end of the evoked signal. Ifinstis anEpochsobject, specifies the index of the first and last epoch to show.- title
str|None The window title. If None a default is provided.
- showbool
Show figure if True.
- blockbool
Whether to halt program execution until the figure is closed. Useful for interactive selection of components in raw and epoch plotter. For evoked, this parameter has no effect. Defaults to False.
- show_first_sampbool
If True, show time axis relative to the
raw.first_samp.- show_scrollbarsbool
Whether to show scrollbars when the plot is initialized. Can be toggled after initialization by pressing z (“zen mode”) while the plot window is focused. Default is
True.New in version 0.19.0.
- time_format‘float’ | ‘clock’
Style of time labels on the horizontal axis. If
'float', labels will be number of seconds from the start of the recording. If'clock', labels will show “clock time” (hours/minutes/seconds) inferred fromraw.info['meas_date']. Default is'float'.New in version 0.24.
- precomputebool |
str Whether to load all data (not just the visible portion) into RAM and apply preprocessing (e.g., projectors) to the full data array in a separate processor thread, instead of window-by-window during scrolling. The default None uses the
MNE_BROWSER_PRECOMPUTEvariable, which defaults to'auto'.'auto'compares available RAM space to the expected size of the precomputed data, and precomputes only if enough RAM is available. This is only used with the Qt backend.New in version 0.24.
Changed in version 1.0: Support for the MNE_BROWSER_PRECOMPUTE config variable.
- use_openglbool |
None Whether to use OpenGL when rendering the plot (requires
pyopengl). May increase performance, but effect is dependent on system CPU and graphics hardware. Only works if using the Qt backend. Default is None, which will use False unless the user configuration variableMNE_BROWSER_USE_OPENGLis set to'true', seemne.set_config().New in version 0.24.
- theme
str| path-like Can be “auto”, “light”, or “dark” or a path-like to a custom stylesheet. For Dark-Mode and automatic Dark-Mode-Detection,
qdarkstyleand darkdetect, respectively, are required. If None (default), the config option MNE_BROWSER_THEME will be used, defaulting to “auto” if it’s not found. Only supported by the'qt'backend.New in version 1.0.
- icainstance of
- Returns
- fig
matplotlib.figure.Figure| mne_qt_browser.figure.MNEQtBrowser Browser instance.
- fig
Notes
For raw and epoch instances, it is possible to select components for exclusion by clicking on the line. The selected components are added to
ica.excludeon close.New in version 0.10.0.