Rn I'm pretty new to matplotlib, I'm plotting a bar chart but I want the y value label above each bar to be hidden when the bar's value is equal to zero
plt.figure(figsize=(12,8))
# set the color palette
palette = ['#FDDA24', '#2C2A29', '#ABA59D', '#F6863C', '#008755', '#4666FF', '#FF3341', '#00BF6F']
# plot the bar chart
ax = sns.barplot(x='Producto', y='Negocios', hue='Sector', data=table_melt, palette=palette)
# set the legend outside the plot
ax.legend(loc='center left', bbox_to_anchor=(1, 0.5))
# add y axis labels
for rect in ax.containers:
ax.bar_label(rect, label_type='edge', fontsize=10)
# add x axis labels rotation
ax.set_xticklabels(ax.get_xticklabels(), rotation=45, ha='right')
# set axis labels and title
ax.set_xlabel('Productos', fontsize=14)
ax.set_ylabel('Número de Negocios', fontsize=14)
ax.set_title('Número de Negocios por Producto y Sector', fontsize=18)
# save the plot as png file
plt.savefig('bar_chart_8_sectors.png', dpi=300, bbox_inches='tight')
# display the plot
plt.show()
I'm trying to show the values of each bar except when the value is zero