我正在制作下面链接的图表,我需要将属于数据顺序的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)
将列CCAA
转换为图前的索引:
(data2.set_index('CCAA')[['Cases','Deaths','Recovered']]
.plot(kind='bar',
figsize=(10, 10),
legend=True,
fontsize=13))