def draw_multiple_profiles(breaks, prfls, cols=[], main='', xlab='', ylab='', ylim=[], v=None, legends=[]):
    
    n_prfls = len(prfls)
    if not ylim: ylim=[min(min_col_by_col(prfls)),max(max_col_by_col(prfls))]
    
    if cols:
        rscript +=R.plot(breaks,prfls[0],col=cols[0],main=main,xlab=xlab,ylab=ylab,ylim=ylim,lwd=2) 
        for i in range(1, n_prfls):
            rscript+=R.lines(breaks,prfls[i],col=[cols[i]],lwd=2)
        rscript+=R.legend(x='topleft', legend=legends, pch=15, col=col[:len(prfls)], bty='o')  
            
    else:
        rval = 'linecols'
        rscript = R.rainbow(1-n_prfls, rval='%s' %rval)
        rscript += '%s <- c(%s, "black")\n' %(rval, rval)
        rscript +=R.plot(breaks,prfls[0],col='%s[1]' %rval, main=main, xlab=xlab, ylab=ylab, ylim=ylim, lwd=2) 
        for i in range(1, n_prfls):
            rscript += R.lines(breaks, prfls[i], col='%s[%d]' %(rval, i+1), lwd=2)
        if not legends:
            legends=['Group %d' %i for i in range(1,len(prfls)+1)]
        rscript+=R.legend(x='topleft', legend=legends, pch=15, col='%s' %(rval), bty='o')
        
    if v!=None: rscript+=R.abline(v=v,lty=2,col=['black'])
    
    return rscript
dataset/ETHPy150Open taoliu/taolib/Assoc/inout.py/draw_multiple_profiles/swapped operands of `-`