

def _plot_update_evoked(params, bools):
    ' update the plot evoked lines\n    '
    (picks, evoked) = [params[k] for k in ('picks', 'evoked')]
    times = (evoked.times * 1000.0)
    projs = [proj for (ii, proj) in enumerate(params['projs']) if (ii in np.where(bools)[0])]
    params['proj_bools'] = bools
    new_evoked = evoked.copy()
    new_evoked.info['projs'] = []
    new_evoked.add_proj(projs)
    new_evoked.apply_proj()
    for (ax, t) in zip(params['axes'], params['ch_types_used']):
        this_scaling = params['scalings'][t]
        idx = [picks[i] for i in range(len(picks)) if (params['types'][i] == t)]
        D = (this_scaling * new_evoked.data[idx, :])
        if (params['plot_type'] == 'butterfly'):
            for (line, di) in zip(ax.lines, D):
                line.set_data(times, di)
        else:
            ax.images[0].set_data(D)
    params['fig'].canvas.draw()

dataset/ETHPy150Open mne-tools/mne-python/mne/viz/evoked.py _plot_update_evoked/original