
我希望删除每个地块顶部的百分比值,或者可能将其围起来。
width = 0.2
x = np.arange(len(labels))
fig2,ax = plt.subplots()
rects1 = ax.bar(x - width/2, precision_data, width, label='precision',color ='firebrick')
rects2 = ax.bar(x + width/2 , recall_data, width, label='recall',color = 'royalblue')
ax.set_ylabel('Score %')
ax.set_title('precision-recall average classifiers scores')
ax.set_xticks(x, labels)
ax.legend()
ax.bar_label(rects1)
ax.bar_label(rects2)`发布于 2022-12-04 09:09:24
ax.bar_label(rects2)
ax.bar_label(rects1)和ax.bar_label(labels, fmt='%.2f')
fmt参数:fmthttps://stackoverflow.com/questions/74674124
复制相似问题