def _epochs_axes_onclick(event, params):
 reject_color = (0.8, 0.8, 0.8)
 ax = event.inaxes
 if (event.inaxes is None):
  return
 p = params
 here = vars(ax)[p['axes_handler'][0]]
 if (here.get('reject', None) is False):
  idx = here['idx']
  if (idx not in p['reject_idx']):
   p['reject_idx'].append(idx)
   for l in ax.lines:
    l.set_color(reject_color)
   here['reject'] = True
 elif (here.get('reject', None) is True):
  idx = here['idx']
  if (idx in p['reject_idx']):
   p['reject_idx'].pop(p['reject_idx'].index(idx))
   good_lines = [ax.lines[k] for k in p['good_ch_idx']]
   for l in good_lines:
    l.set_color('k')
   if (p['bad_ch_idx'] is not None):
    bad_lines = ax.lines[(- len(p['bad_ch_idx'])):]
    for l in bad_lines:
     l.set_color('r')
   here['reject'] = False
 ax.get_figure().canvas.draw()

def _epochs_axes_onclick ( event , params ) : reject_color = ( 0.8 , 0.8 , 0.8 ) ax = event . inaxes if ( event . inaxes is None ) : return p = params here = vars ( ax ) [ p [ 'axes_handler' ] [ 0 ] ] if ( here . get ( 'reject' , None ) is False ) : idx = here [ 'idx' ] if ( idx not in p [ 'reject_idx' ] ) : p [ 'reject_idx' ] . append ( idx ) for l in ax . lines : l . set_color ( reject_color ) here [ 'reject' ] = True elif ( here . get ( 'reject' , None ) is True ) : idx = here [ 'idx' ] if ( idx in p [ 'reject_idx' ] ) : p [ 'reject_idx' ] . pop ( p [ 'reject_idx' ] . index ( idx ) ) good_lines = [ ax . lines [ k ] for k in p [ 'good_ch_idx' ] ] for l in good_lines : l . set_color ( 'k' ) if ( p [ 'bad_ch_idx' ] is not None ) : bad_lines = ax . lines [ ( - len ( p [ 'bad_ch_idx' ] ) ) : ] for l in bad_lines : l . set_color ( 'r' ) here [ 'reject' ] = False ax . get_figure ( ) . canvas . draw ( )
handle epochs axes click .