def _onpick(event, params):
 if ((event.mouseevent.button != 2) or (not params['butterfly'])):
  return
 lidx = np.where([(l is event.artist) for l in params['lines']])[0][0]
 text = params['text']
 text.set_x(event.mouseevent.xdata)
 text.set_y(event.mouseevent.ydata)
 text.set_text(params['ch_names'][lidx])
 text.set_visible(True)

def _onpick ( event , params ) : if ( ( event . mouseevent . button != 2 ) or ( not params [ 'butterfly' ] ) ) : return lidx = np . where ( [ ( l is event . artist ) for l in params [ 'lines' ] ] ) [ 0 ] [ 0 ] text = params [ 'text' ] text . set_x ( event . mouseevent . xdata ) text . set_y ( event . mouseevent . ydata ) text . set_text ( params [ 'ch_names' ] [ lidx ] ) text . set_visible ( True )
add a channel name on click .