【发布时间】:2021-05-29 15:37:30
【问题描述】:
我有一个系列如下:
Country
India 691904
China 659962
United Kingdom of Great Britain and Northern Ireland 551500
Philippines 511391
Pakistan 241600
United States of America 241122
Iran (Islamic Republic of) 175923
Sri Lanka 148358
Republic of Korea 142581
绘制水平条形图后,图x轴从低到高排列
问: 1) 如何将 y 轴从高到低排列?
2) 有没有更简单的方法将除最高值(在本例中为印度)之外的所有条形都涂成灰色,而无需输入所有国家/地区名称?
谢谢!
ax = top15.plot(kind='barh',
figsize=(20,10),
color = {'red':'India'})
ax.set_title('Immigration from 1980 - 2013')
ax.set_xlabel('Total Number')
【问题讨论】:
标签: python pandas matplotlib