簡體   English   中英

條形圖上的不需要的標簽與matplotlib

[英]Unwanted labels on bar plot with matplotlib

我在我的所有酒吧都得到零,盡管設法通過設置yerr = None來刪除它們,我仍然遇到同樣的問題。 否則條形圖正確。 如何刪除每個條形圖上方打印的0。

N = len(my_tuple)
plt.figure(0)
ind = np.arange(N)  
width = 0.35       
fig, ax = plt.subplots()
rects1 = ax.bar(ind, g_tuple, width, color='r',  linewidth=2,alpha=0.8)
rects2 = ax.bar(ind+width, f_tuple, width, color='y', linewidth=2,alpha=0.8)
ax.set_ylabel('XXX')
ax.set_title('XXX')
ax.set_xticks(ind+width)
ax.set_xticklabels( lob_tuple )
ax.legend( (rects1[0], rects2[0]), ('G', 'F') )
autolabel(rects1)
autolabel(rects2)

我試過yerr=Noneyerr=0 ,但這也不起作用

當我在bar方法中查看時,原來它的autolabel命令執行此操作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM