enter image description here我是Python编程的初学者,我需要你的帮助
我试着根据横条在y轴上的位置,将横条的值放在横条的顶部或上方。在y轴的正侧,我想把值放在条的上方,在负侧,我想把值放在条的下方
我也在尝试把这些条的标签放在图的顶部,颜色和这些条一样
新的:
ax.1+plt.bar(r,元素,颜色=条形图颜色,边色=无,宽度=宽度) ax=dataset.plot(宽度=5.0,种类=bar',y=dataset.columns,figsize=(6,5),zorder=3)
对于ax.patches中的p: ax.注释(“%.2f”%p.get.height(),(p.get\u x()+p.get.width()/2.,p.get\u height()),ha='center',va='center',xytext=(0,10),textcoords='offsetpoints')
你在找这样的东西吗。如果是,则尝试使用
ax.patches
在条形图上输入值df:
相关问题 更多 >
编程相关推荐