I have Matplotlib 1.1.0, and am doing point picking (using the OO approach
to Matplotlib, and embedded in wxPython).  My relevant code is as follows:

#connect the pick event to the pick event handler:
self.cid = self.canvas.mpl_connect('pick_event', self.on_pick)

#This is the relevant part of the pick event handler:
def on_pick(self, event):
    if isinstance(event.artist, Line2D):
            ind = event.ind
            print 'ind is: ', str(ind)

This had been working in some cases, but I've found a case in which it
appears to be giving me a value for ind that doesn't make sense.  For
example, I have a plot with two lines on it (and two y axes), each with
over 50 points.  When I pick one of the points right near the end, I expect
the ind here will be about 50.  However, it prints ind is: 3.  In other
words, the wrong index value.  This is a serious issue for me, because I
then use that index to look up information about that point.

What could be going on here?

Thanks,
Che
------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to