我有以下数据框:
frame1 = pd.DataFrame(res.items(), columns=['Region', 'Ratio'])
Region Ratio
0 Midwest 0.005669
1 Northeast 0.008920
2 North 0.006374
3 South 0.002904
4 Southeast 0.001928
现在我想用带有区域名称的ylabel绘制上面数据帧的(hbar),但是,我只得到y标签上的数字(0到4),如下所示:
frame1['Ratio'].plot(y=frame1['Region'], x=frame1['Ratio'], kind="barh", align='center', color='blue')
如何绘制每个区域的名称? 提前谢谢
索引将是
yaxis
标签,您可以尝试以下方法:相关问题 更多 >
编程相关推荐