1 import pandas 2 from matplotlib import pyplot 3 excel=pandas.read_excel(‘填充日期.xlsx‘) 4 excel.sort_values(by=‘score‘,ascending=False,inplace=True) 5 print(excel) 6 #开始绘制柱状图 7 #excel.plot.bar(x=‘name‘,y=‘score‘,color=‘orange‘,title=‘score‘) 8 pyplot.bar(excel.name,excel.score,color=‘orange‘) 9 pyplot.xticks(excel.name,rotation=45) 10 pyplot.yticks(excel.score,rotation=45) 11 12 13 pyplot.tight_layout() #紧凑放置 14 pyplot.show()
原文:https://www.cnblogs.com/energetic/p/13071967.html