zoukankan      html  css  js  c++  java
  • 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)
    
  • 相关阅读:
    iOS数据持久化—FMDB框架的简单介绍
    iOS数据持久化—SQLite常用的函数
    多段图动态规划dp
    Cucumber测试驱动开发
    敏捷开发XP
    Android 小票打印USB
    TextInputLayout 用法
    Snackbar 提醒
    PermissionDispatcher 运行时权限框架
    Tinker 热修复
  • 原文地址:https://www.cnblogs.com/yangjing000/p/9773544.html
Copyright © 2011-2022 走看看