Plot CDF + cumulative histogram using Seaborn Python

后端 未结 2 844
暗喜
暗喜 2020-12-23 12:41

Is there a way to plot the CDF + cumulative histogram of a Pandas Series in Python using Seaborn only? I have the following:

import numpy as np
import pandas         


        
相关标签:
2条回答
  • 2020-12-23 13:13
    import numpy as np
    import seaborn as sns
    
    x = np.random.randn(200)
    kwargs = {'cumulative': True}
    sns.distplot(x, hist_kws=kwargs, kde_kws=kwargs)
    

    0 讨论(0)
  • 2020-12-23 13:23

    You can get almost the same plot using matplotlib by using cumulative=True and density=True.

    plt.hist(x,cumulative=True, density=True, bins=30)

    0 讨论(0)
提交回复
热议问题