Hi John,

John Hunter <jdh2...@gmail.com> 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


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to