def __init__(self, ax, onselect, direction, minspan=None, useblit=False, rectprops=None, onmove_callback=None):
if rectprops is None:<EOL><INDENT>rectprops = dict(facecolor='<STR_LIT>', alpha=<NUM_LIT:0.5>)<EOL><DEDENT>assert direction in ['<STR_LIT>', '<STR_LIT>'], '<STR_LIT>'<EOL>self.direction = direction<EOL>self.ax = None<EOL>self.canvas = None<EOL>self.visible = True<EOL>self.cids=[]<EOL>self.rect = None<EOL>self.background = None<EOL>self.pressv = None<EOL>self.rectprops = rectprops<EOL>self.onselect = onselect<EOL>self.onmove_callback = onmove_callback<EOL>self.useblit = useblit<EOL>self.minspan = minspan<EOL>self.buttonDown = False<EOL>self.prev = (<NUM_LIT:0>, <NUM_LIT:0>)<EOL>self.new_axes(ax)<EOL>
Create a span selector in ax.  When a selection is made, clear
the span and call onselect with

  onselect(vmin, vmax)

and clear the span.

direction must be 'horizontal' or 'vertical'

If minspan is not None, ignore events smaller than minspan

The span rect is drawn with rectprops; default
  rectprops = dict(facecolor='red', alpha=0.5)

set the visible attribute to False if you want to turn off
the functionality of the span selector