'When the line is picked, update the set of selected indicies.'

def onpick(self, event):

    if (event.artist is not self.line):
        return
    self.ind ^= set(event.ind)
    ind = sorted(self.ind)
    (xdata, ydata) = self.line.get_data()
    self.process_selected(ind, xdata[ind], ydata[ind])
