lib/matplotlib/image.py
def contains(self, mouseevent):
        """
        Test whether the mouse event occured within the image.
        """
        if callable(self._contains): return self._contains(self,mouseevent)
        # TODO: make sure this is consistent with patch and patch
        # collection on nonlinear transformed coordinates.
        # TODO: consider returning image coordinates (shouldn't
        # be too difficult given that the image is rectilinear
        x, y = mouseevent.xdata, mouseevent.ydata
        xmin, xmax, ymin, ymax = self.get_extent()
        if xmin > xmax:
            xmin,xmax = xmax,xmin
        if ymin > ymax:
            ymin,ymax = ymax,ymin
        #print x, y, xmin, xmax, ymin, ymax
        if x is not None and y is not None:
            inside = x>=xmin and x<=xmax and y>=ymin and y<=ymax
        else:
            inside = False

        return inside,{}

        Test whether the mouse event occured within the image.
        
Test whether the mouse event occured within the image.
Test whether the mouse event occured within the image .
def contains(self, mouseevent):
        if callable(self._contains): return self._contains(self,mouseevent)
        x, y = mouseevent.xdata, mouseevent.ydata
        xmin, xmax, ymin, ymax = self.get_extent()
        if xmin > xmax:
            xmin,xmax = xmax,xmin
        if ymin > ymax:
            ymin,ymax = ymax,ymin
        if x is not None and y is not None:
            inside = x>=xmin and x<=xmax and y>=ymin and y<=ymax
        else:
            inside = False
        return inside,{}
def contains ( self , mouseevent ) : if callable ( self . _contains ) : return self . _contains ( self , mouseevent ) x , y = mouseevent . xdata , mouseevent . ydata xmin , xmax , ymin , ymax = self . get_extent ( ) if xmin > xmax : xmin , xmax = xmax , xmin if ymin > ymax : ymin , ymax = ymax , ymin if x is not None and y is not None : inside = x >= xmin and x <= xmax and y >= ymin and y <= ymax else : inside = False return inside , { }
Test whether the mouse event occured within the image.
Test whether the mouse event occured within the image .
"""
        Test whether the mouse event occured within the image.
        """ # TODO: make sure this is consistent with patch and patch # collection on nonlinear transformed coordinates. # TODO: consider returning image coordinates (shouldn't # be too difficult given that the image is rectilinear #print x, y, xmin, xmax, ymin, ymax
self
mouseevent