def plotEstimError(rs,name, media):
    errors = getXYEstimError(name)
    factor = min(1, 100./len(errors.items()))

    for k,v in errors.items():
        if  rd.random()<factor:
            index, er = [], []
            for j in range(len(v)):
#            for j in range(20):
#                index.append(j*rs.dt)
                index.append(j)
                er.append(v[j])
            media.plot(index,er, c ='b')
def plotEstimError(rs, name, media):
    errors = getXYEstimError(name)
    factor = min(1, 100. / len(errors.items()))

    for k, v in errors.items():
        if rd.random() < factor:
            index, er = [], []
            for j in range(len(v)):
                #            for j in range(20):
                #                index.append(j*rs.dt)
                index.append(j)
                er.append(v[j])
            media.plot(index, er, c='b')