【发布时间】:2021-12-26 03:13:32
【问题描述】:
我有以下格式的三个数据框,其中有一列以数字格式显示一年中的月份,而与之相邻的一列则显示该月发生的项目数。我想创建一个重叠直方图,详细说明三个直方图之间的分布,但由于某种原因,我一直得到同样的结果!
month_box Sum Value
0 1 4812
1 2 2053
2 3 2405
3 4 2353
4 5 2427
5 6 2484
6 8 2579
7 9 2580
8 10 2497
9 11 2510
10 12 2202
我使用的代码如下:
sns.distplot(bex_boxdf['month_box'],kde=False,label = 'Bexley')
sns.distplot(west_boxdf['month_box'],kde=False,label = 'Westminster')
sns.distplot(gwch_boxdf['month_box'],kde=False,label = 'Greenwich')
plt.legend(prop={'size': 12})
plt.title('Crime by month')
plt.xlabel('Month')
plt.ylabel('Density')
【问题讨论】: