Can't pick on various scatter markers

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()

This bug or feature? is still in matplotlib 0.99.1.1 (Ubuntu 10.04 LTS)

More precisely scatter using symbols with zero area ('x', '+') will not
pick, regardless of the float value in picker.
Although this DOES work with plot, you can't vary the marker size between
points like you can with scatter.
I have also confirmed this in a version of the example in the docs
http://matplotlib.sourceforge.net/users/event_handling.html#picking-exercise
Which I could upload, but the code below is just fine.

If this is a feature, I suggest it be stated in the documentation.

Kyle Whitmer wrote:

···

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()

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the
world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

--
View this message in context: http://old.nabble.com/Can't-pick-on-various-scatter-markers-tp19140977p31305085.html
Sent from the matplotlib - users mailing list archive at Nabble.com.