• 20181011_matplotlib


    import numpy as np
    import pandas as pd
    import matplotlib.pyplot as plt
    
    df=pd.DataFrame(np.random.randn(6,4),index=['one','two','three','four','five','six'],columns=pd.Index(['A','B','C','D'],name='Gnes'))
    df.columns
    
    Index(['A', 'B', 'C', 'D'], dtype='object', name='Gnes')
    
    abs(df).plot(kind='barh',stacked=True,alpha=0.9)
    

    comp1=np.random.normal(0,1,size=200)
    comp2=np.random.normal(10,2,size=200)
    values=pd.Series(np.concatenate([comp1,comp2]))
    values.hist(bins=100,alpha=0.6,color='g',normed=True)
    values.plot(kind='kde',style='-')
    

    df2=pd.DataFrame(np.random.rand(50,4),columns=pd.Index(['A','B','C','D'],name='MAC_#YJ'))
    
    diff_df2=df2.diff()
    plt.scatter(diff_df2['B'],diff_df2['A'])
    

    pd.plotting.scatter_matrix(diff_df2,diagonal='kde',color='g',alpha=0.8)
    

    date_df=pd.Series(np.random.rand(30),index=pd.date_range('10/11/2018',periods=30))
    fig=plt.figure()
    axes=fig.add_subplot()
    import seaborn as sns
    sns.set(style="darkgrid")
    # Plot the responses for different events and regions
    sns.lineplot(x="timepoint", y="signal",col='vars',
                 hue="region", style="event",
                 data=date_df)
    
  • 相关阅读:
    ext DateTime.js在ie下显示不全
    js 获得每周周日到周一日期
    近十年one-to-one最短路算法研究整理【转】
    虚函数(实现多态)
    函数调用机制2
    函数调用机制
    面向对象的三大特性
    矩阵类c++实现
    矩阵求逆c++实现
    解决文件大小上传限制
  • 原文地址:https://www.cnblogs.com/yangjing000/p/9773544.html
Copyright © 2020-2023  润新知