# -*-coding:utf-8 -*-
import pandas as pd
import matplotlib.pyplot as plt
weeks = pd.read_excel('C:/Users/asus/Downloads/pandas/013/Orders.xlsx',index_col='Week')
print(weeks)
print(weeks.columns)
weeks.plot.bar(y=['Accessories', 'Bikes', 'Clothing', 'Components'],stacked=True)
plt.title('Sales Weekly Trend',fontsize=16,fontweight='bold')
plt.ylabel('Total',fontsize=12,fontweight='bold')
plt.xticks(weeks.index,fontsize=8)
plt.show()
pandas-matplotlib绘制折线趋势图,叠加区域图
最新推荐文章于 2023-03-22 20:08:11 发布