I’m having trouble using picker on a scatter plots with various markers (e.g. + and x). It works with the plot command fine. What am I missing?

Sample code below.

import numpy

import pylab

def onpick(event):

print ‘Pick:’,event.ind

fig = pylab.figure()

ax = fig.add_subplot(111)

x1,y1 = numpy.random.random((2,100))

series1=ax.plot(x1,y1,marker=‘x’,color=‘b’,linestyle=’’,label=‘plot’,picker=5)

x2,y2 = numpy.random.random((2,100))

series2=ax.scatter(x2,y2,marker=‘x’,color=‘g’,label=‘scatter-X’,picker=5)

x3,y3 = numpy.random.random((2,100))

series3=ax.scatter(x3,y3,marker=‘o’,color=‘r’,label=‘scatter-O’,picker=5)

fig.canvas.mpl_connect(‘pick_event’,onpick)

pylab.legend()

pylab.show()