Matplotlib event_handling line picker
This example makes it possible to click a legend and thereby change a plot. I want to do something similar, but then not by clicking the legend, just by clicking the line in the plot. I tried to do it like this: self.ax = self.fig.add_subplot(1,2,1) data = NP.array(2,10) #filled with numbers self.x = NP.arange(2) for line in range(len(data[0,:])): self.ax.plot(self.x, data[:,line], picker=5) In every loop, an extra line is plotted. One line consists of 2 points, so it draws a straight line. But now every loop, the picker is the same, so no matter which line I click, the commands I wrote to