'Get the xdata and ydata for event, with limits'

def _get_data(self, event):

    if (event.xdata is None):
        return (None, None)
    (x0, x1) = self.ax.get_xbound()
    (y0, y1) = self.ax.get_ybound()
    xdata = max(x0, event.xdata)
    xdata = min(x1, xdata)
    ydata = max(y0, event.ydata)
    ydata = min(y1, ydata)
    return (xdata, ydata)
