@requires_sklearn
def test_plot_ica_overlay():
 import matplotlib.pyplot as plt
 raw = _get_raw(preload=True)
 picks = _get_picks(raw)
 ica = ICA(noise_cov=read_cov(cov_fname), n_components=2, max_pca_components=3, n_pca_components=3)
 with warnings.catch_warnings(record=True):
  ica.fit(raw, picks=picks)
 with warnings.catch_warnings(record=True):
  ecg_epochs = create_ecg_epochs(raw, picks=picks)
 ica.plot_overlay(ecg_epochs.average())
 with warnings.catch_warnings(record=True):
  eog_epochs = create_eog_epochs(raw, picks=picks)
 ica.plot_overlay(eog_epochs.average())
 assert_raises(ValueError, ica.plot_overlay, raw[:2, :3][0])
 ica.plot_overlay(raw)
 plt.close('all')

@ requires_sklearn def test_plot_ica_overlay ( ) : import matplotlib . pyplot as plt raw = _get_raw ( preload = True ) picks = _get_picks ( raw ) ica = ICA ( noise_cov = read_cov ( cov_fname ) , n_components = 2 , max_pca_components = 3 , n_pca_components = 3 ) with warnings . catch_warnings ( record = True ) : ica . fit ( raw , picks = picks ) with warnings . catch_warnings ( record = True ) : ecg_epochs = create_ecg_epochs ( raw , picks = picks ) ica . plot_overlay ( ecg_epochs . average ( ) ) with warnings . catch_warnings ( record = True ) : eog_epochs = create_eog_epochs ( raw , picks = picks ) ica . plot_overlay ( eog_epochs . average ( ) ) assert_raises ( ValueError , ica . plot_overlay , raw [ : 2 , : 3 ] [ 0 ] ) ica . plot_overlay ( raw ) plt . close ( 'all' )
test plotting of ica cleaning .