我在一篇论文中发现了一个很好的条形图,想做一些类似的东西,但不知道怎么做。我想做的数字如下
import matplotlib.pyplot as plt
import numpy as np, pandas as pd, seaborn as sns;
data = np.array([[0.3,0.4,0.7],
[0.5, 0.3, 0.8 ],
[0.7,0.2,0.5],
[0.2,0.4,0.1],
[0.3,0.1, 0.8],
[0.5,0.9, 0.2],
[1.4,1.7,1.2],
[0.4,0.8, 0.3],
[1.8,2.6, 0.4],
[2.7,3.7, 2.1],
[0.1,4.1, 2.4]])
data_df = pd.DataFrame(data, columns=['SMB', 'HML', 'MOM'], index = ['OLS3', 'EN', 'GLM', 'NN1','NN2','NN3','NN4','NN5','NN6', 'NN7','NN7'])
然后我试着创建这样的条形图:
data_df.plot(kind='bar',figsize=(16, 10))
但这不是我想要的。有人知道如何制作与我添加的图片相似的图片吗?你知道吗
输出:
相关问题 更多 >
编程相关推荐