def sweep(ABF,sweep=None,rainbow=True,alpha=None,protocol=False,color='<STR_LIT:b>',<EOL>continuous=False,offsetX=<NUM_LIT:0>,offsetY=<NUM_LIT:0>,minutes=False,<EOL>decimate=None,newFigure=False):
if len(pylab.get_fignums())==<NUM_LIT:0> or newFigure:<EOL><INDENT>new(ABF,True)<EOL><DEDENT>if offsetY><NUM_LIT:0>:<EOL><INDENT>pylab.grid(None)<EOL><DEDENT>if sweep is None:<EOL><INDENT>sweeps=[ABF.currentSweep]<EOL>if not ABF.currentSweep:<EOL><INDENT>sweeps=[<NUM_LIT:0>]<EOL><DEDENT><DEDENT>elif sweep=="<STR_LIT:all>":<EOL><INDENT>sweeps=range(<NUM_LIT:0>,ABF.sweeps)<EOL><DEDENT>elif type(sweep) in [int,float]:<EOL><INDENT>sweeps=[int(sweep)]<EOL><DEDENT>elif type(sweep) is list:<EOL><INDENT>sweeps=sweep<EOL><DEDENT>else:<EOL><INDENT>print("<STR_LIT>",type(sweep),sweep)<EOL><DEDENT>if continuous:<EOL><INDENT>offsetX=ABF.sweepInterval<EOL><DEDENT>colors=[color]*len(sweeps) <EOL>if rainbow and len(sweeps)><NUM_LIT:1>:<EOL><INDENT>for i in range(len(sweeps)):<EOL><INDENT>colors[i]=ABF.colormap[i]<EOL><DEDENT><DEDENT>if alpha is None and len(sweeps)==<NUM_LIT:1>:<EOL><INDENT>alpha=<NUM_LIT:1><EOL><DEDENT>if rainbow and alpha is None:<EOL><INDENT>alpha=<NUM_LIT><EOL><DEDENT>if alpha is None:<EOL><INDENT>alpha=<NUM_LIT:1><EOL><DEDENT>if minutes == False:<EOL><INDENT>minutes=<NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>minutes=<NUM_LIT><EOL>pylab.xlabel("<STR_LIT>")<EOL><DEDENT>ABF.decimateMethod=decimate<EOL>for i in range(len(sweeps)):<EOL><INDENT>ABF.setSweep(sweeps[i])<EOL>if protocol:<EOL><INDENT>pylab.plot((np.array(ABF.protoX)/ABF.rate+offsetX*i)/minutes,<EOL>ABF.protoY+offsetY*i,<EOL>alpha=alpha,color=colors[i])<EOL><DEDENT>else:<EOL><INDENT>pylab.plot((ABF.dataX+offsetX*i)/minutes,<EOL>ABF.dataY+offsetY*i,alpha=alpha,color=colors[i])<EOL><DEDENT><DEDENT>ABF.decimateMethod=None<EOL>pylab.margins(<NUM_LIT:0>,<NUM_LIT>)<EOL>
Load a particular sweep then plot it.
If sweep is None or False, just plot current dataX/dataY.
If rainbow, it'll make it color coded prettily.