python - Pandas 条形图轴
问题描述
我正在制作下面链接的图表,我需要将属于数据顺序的 x 轴更改为 CCAA 或城市。我该怎么做?谢谢!
data = data.sort_values(by=['Cases'], ascending=False)
Combined = data2[['Cases','Deaths','Recovered']].plot(kind='bar',[enter image description here][1] figsize=(10, 10), legend=True, fontsize=13 )
plt.show
解决方案
指定xticks
data2[['Cases','Deaths','Recovered']].plot(
kind='bar', figsize=(10, 10),
legend=True, fontsize=13,
xticks=data2.CCAA)
推荐阅读
- java - 如何在 kafka 主题中发布之前删除消息有效负载中的空字段
- javascript - How to make a moving/sliding element in Three.js?
- python - Flask CLI:如何打印 ImportError 的回溯或库名称
- excel - excel 正弦函数如何处理错误输入?
- arrays - 数组值被数组中添加的最后一个值替换
- itfoxtec-identity-saml2 - 使用 .Net Core 5 MVC 为多个 IDP 实施 SAML2
- node.js - 如何使用主键和外键代替带有 Sequelize 的桥表来建模 M:N 关系?
- google-chrome-extension - 没有 [空格] 或 [制表符] 的 chrome 扩展多功能框快捷关键字
- python - 根据另一列的类别计算列中特定值的出现次数
- python - 如何将 numpy 数组转换为 numpy 元组数组?