'on button release event'

def _release(self, event):

    if (not self.interactive):
        self.to_draw.set_visible(False)
    (x1, x2, y1, y2) = self.extents
    self.eventpress.xdata = x1
    self.eventpress.ydata = y1
    xy1 = self.ax.transData.transform_point([x1, y1])
    (self.eventpress.x, self.eventpress.y) = xy1
    self.eventrelease.xdata = x2
    self.eventrelease.ydata = y2
    xy2 = self.ax.transData.transform_point([x2, y2])
    (self.eventrelease.x, self.eventrelease.y) = xy2
    if (self.spancoords == u'data'):
        (xmin, ymin) = (self.eventpress.xdata, self.eventpress.ydata)
        (xmax, ymax) = (self.eventrelease.xdata, self.eventrelease.ydata)
    elif (self.spancoords == u'pixels'):
        (xmin, ymin) = (self.eventpress.x, self.eventpress.y)
        (xmax, ymax) = (self.eventrelease.x, self.eventrelease.y)
    else:
        raise ValueError(u'spancoords    must    be    "data"    or    "pixels"')
    if (xmin > xmax):
        (xmin, xmax) = (xmax, xmin)
    if (ymin > ymax):
        (ymin, ymax) = (ymax, ymin)
    spanx = (xmax - xmin)
    spany = (ymax - ymin)
    xproblems = ((self.minspanx is not None) and (spanx < self.minspanx))
    yproblems = ((self.minspany is not None) and (spany < self.minspany))
    if ((self.drawtype != u'none') and (xproblems or yproblems)):
        for artist in self.artists:
            artist.set_visible(False)
        self.update()
        return
    self.onselect(self.eventpress, self.eventrelease)
    self.update()
    return False
