def release(self, event):
if self.eventpress is None or self.ignore(event): return<EOL>self.to_draw.set_visible(False)<EOL>self.canvas.draw()<EOL>self.eventrelease = event<EOL>if self.spancoords=='<STR_LIT:data>':<EOL><INDENT>xmin, ymin = self.eventpress.xdata, self.eventpress.ydata<EOL>xmax, ymax = self.eventrelease.xdata, self.eventrelease.ydata<EOL><DEDENT>elif self.spancoords=='<STR_LIT>':<EOL><INDENT>xmin, ymin = self.eventpress.x, self.eventpress.y<EOL>xmax, ymax = self.eventrelease.x, self.eventrelease.y<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if xmin>xmax: xmin, xmax = xmax, xmin<EOL>if ymin>ymax: ymin, ymax = ymax, ymin<EOL>spanx = xmax - xmin<EOL>spany = ymax - ymin<EOL>xproblems = self.minspanx is not None and spanx<self.minspanx<EOL>yproblems = self.minspany is not None and spany<self.minspany<EOL>if (self.drawtype=='<STR_LIT>')  and (xproblems or  yproblems):<EOL><INDENT>"""<STR_LIT>"""     <EOL>return                 <EOL><DEDENT>if (self.drawtype=='<STR_LIT>') and (xproblems and yproblems):<EOL><INDENT>"""<STR_LIT>"""    <EOL>return                 <EOL><DEDENT>self.onselect(self.eventpress, self.eventrelease)<EOL>self.eventpress = None                <EOL>self.eventrelease = None              <EOL>return False<EOL>
on button release event