|
From: Ole S. <ole...@gm...> - 2009-06-10 14:04:52
|
Hi John,
John Hunter <jd...@gm...> writes:
> If for some reason the built in pick_event is unsuitable, you can
> create your own matplotlib.backend_bases.MouseEvent and call
> line.contains(event) for each line you want to hit test.
Thank you, that works for me. But for some reason, the "y" coordinate is
inversed in Qt and matplotlib? I have to specify
def get_lines_at_point(self, point):
mpl_event = MouseEvent('button_press_event', self,
point.x(), self.height() - point.y())
#########################
ret = [ ]
for line in self.axes.get_lines():
picked, details = line.contains(mpl_event)
if picked:
ret.append(line)
return ret
The other question that now remains is: how can I remove a line from an
axes?
Best regards
Ole
|