Python新手在这里。我想在下图中显示每个 bin 上方的值:这是我的代码:x=[i for i in range(1,11)]y=[0.95,0.95,0.89,0.8,0.74,0.65,0.59,0.51,0.5,0.48]plt.bar(x, height= y)xlocs, xlabs = plt.xticks()xlocs=[i+1 for i in range(0,10)]xlabs=[i/2 for i in range(0,10)]plt.xlabel('Max Sigma')plt.ylabel('Test Accuracy')plt.xticks(xlocs, xlabs)plt.show()这是我想要的图表:
添加回答
举报
0/150
提交
取消