画图函数

1 plt.bar(left =x_label ,height = tuple_val,width = 0.35)
2 
3 for a,b in zip(x_label,tuple_val):
4     plt.text(a, b+0.05, '%.2f' % b, ha='center', va= 'bottom',fontsize=11)
5 plt.legend()
6 plt.show()

 

使用text对柱状图添加标签
posted @ 2018-12-11 15:18  you-wh  阅读(104)  评论(0编辑  收藏  举报
Fork me on GitHub