1 import  pandas
 2 from  matplotlib  import pyplot
 3 pyplot.rcParams['font.sans-serif']=['simhei'] #显示中文标签
 4 pyplot.rcParams['axes.unicode_minus']=False
 5 
 6 #绘制折线图
 7 excel=pandas.read_excel('填充日期.xlsx',index_col='name')
 8 excel.plot(y=['score1','score2','score3'])
 9 pyplot.title('学生成绩',fontsize=16,fontweight='bold')
10 pyplot.ylabel('分数',fontsize=16,fontweight='bold')
11 
12 
13 #生成叠加区域图
14 excel.plot.area(y=['score1','score2','score3'])
15 #生成叠加柱状图
16 excel.plot.bar(y=['score1','score2','score3'],stacked=True)
17 
18 
19 pyplot.show()

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2023-01-15
  • 2022-01-18
猜你喜欢
  • 2021-05-20
  • 2022-12-23
  • 2021-07-28
  • 2021-10-17
  • 2021-12-20
  • 2021-09-16
  • 2022-12-23
相关资源
相似解决方案