trying to use ica.plot_overlay

Hi all,
I'm having trouble following the tutorial for Artifact Correction with ICA.
http://martinos.org/mne/stable/auto_tutorials/plot_artifacts_correction_ica.html?highlight=ica%20fit

I have epoched data where my artifact is timed to the event; I'm not
investigating EOG artifact. I am able to use ica.plot_properties and
ica.plot_sources fine. But when I try to do ica.plot_overlay, it looks
like it's not excluding my bad component. Since artifact is timed to
event, average is just the averaged epochs.

Attached: images from ica.plot_properties, ica.plot_sources, and
ica.plot_overlay. I'm not exactly clear on what picks and exclude expects
(list, array, int?).

Commands used are below.
Thanks very much for any help!

Megan

random_state = 23
n_components =50 # if float, select n_components by explained variance of PCA
method = 'fastica' # for comparison with EEGLAB try "extended-infomax" here
decim = 3 # we need sufficient statistics, not all time points -> saves time
reject=None # artifact is rather large, so don't want to reject it...

ica = ICA(n_components=n_components, method=method, random_state=random_state)
ica.fit(epochs, picks=picks_meg, decim=decim, reject=reject)

ica.plot_sources(epochs)

epoch_avg= epochs.average()

ica.plot_sources(epoch_avg, exclude=['35'])

ica.plot_properties(epochs, picks=35, psd_args={'fmax': 35.},
                    image_args={'sigma': 1.})

# Following lines included with input and output:

In [72]: ica.plot_overlay(epoch_avg, exclude=['35'], show=False)
Transforming to ICA space (50 components)
/export/research/analysis/human/jstephen/shared/programs/python/anaconda3/lib/python3.5/site-packages/numpy/lib/arraysetops.py:375:
FutureWarning: elementwise comparison failed; returning scalar
instead, but in the future will perform elementwise comparison
  mask &= (ar1 != a)
Zeroing out 0 ICA components
Out[72]: <matplotlib.figure.Figure at 0x7f8c469d55c0>

In [74]: mne.__version__
Out[74]: '0.14.dev0'

MEG Technician
The Mind Research Network
1101 Yale Blvd. NE
Albuquerque, New Mexico 87106
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20171002/46125eae/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot 2017-10-02 at 4.47.15 PM.png
Type: image/png
Size: 416492 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20171002/46125eae/attachment-0003.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot 2017-10-02 at 4.14.55 PM.png
Type: image/png
Size: 610496 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20171002/46125eae/attachment-0004.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot 2017-10-02 at 3.51.50 PM.png
Type: image/png
Size: 646946 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20171002/46125eae/attachment-0005.png

hi Megan,

can you try with:

ica.plot_sources(epoch_avg, exclude=[35])

exclude should be in an int not a string.

Alex

Thank you, Alex! That was my problem.

Megan

MEG Technician
The Mind Research Network
1101 Yale Blvd. NE
Albuquerque, New Mexico 87106