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 #開始繪制柱狀圖 8 #excel.plot.bar(x='name',y='score',color='orange',title='score') 9 pyplot.bar(excel.name,excel.score,color='orange') 10 pyplot.xticks(excel.name,rotation=45) 11 pyplot.yticks(excel.score,rotation=45) 12 13 14 pyplot.tight_layout() #緊湊放置 15 pyplot.show()
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/137689.html
標籤:Python
下一篇:往excel中插入柱狀圖
