How to plot cdf in matplotlib in Python?

后端 未结 5 1619
粉色の甜心
粉色の甜心 2020-12-14 08:51

I have a disordered list named d that looks like:

[0.0000, 123.9877,0.0000,9870.9876, ...]

I just simply want to plot a cdf gr

5条回答
  •  情歌与酒
    2020-12-14 09:28

    import matplotlib.pyplot as plt
    X=sorted(data)
    Y=[]
    l=len(X)
    Y.append(float(1)/l)
    for i in range(2,l+1):
        Y.append(float(1)/l+Y[i-2])
    plt.plot(X,Y,color=c,marker='o',label='xyz')
    

    I guess this would do,for the procedure refer http://www.youtube.com/watch?v=vcoCVVs0fRI

提交回复
热议问题