No artists with labels found to put in legend. Note that artists whose label start with an underscore are ignored when legend() is called with no argument.
#legend相关代码中缺乏label名称的说明,需要给予图例对应的名字
plt.legend(loc=4, bbox_to_anchor=(1.15, -0.07))#原代码报错并不显示图例
plt.legend(loc=4, bbox_to_anchor=(1.15, -0.07),labels=['频次']) # 调整后不报错并显示图例