|
From: C M <cmp...@gm...> - 2013-09-15 21:30:54
|
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
|