I have plotted a chart using some values in python-matplot lib, But i wanted to show values inside the bars, I tried something, Now i'm able to get values, That is not inside the bars, Its position is not correct. Can anyone help me out of this?
import matplotlib.pyplot as plt
tick_label = ['Impacted Lines', 'Added/Edited', 'Table type change', 'Deleted']
def addlabels(x,y):
for i in range(len(x)):
plt.text(i, y[i]//2,y[i], ha = 'center',bbox = dict(facecolor = 'white', alpha = .5))
x_axis=[1,2,3,4]
y_axis=[3, 2, 6, 1]
plt.bar(x_axis, y_axis,tick_label = tick_label,width = 0.8, color = ['orange', 'green','blue','red'])
plt.ylim(0, len(output))
addlabels(x_axis,y_axis)
plt.ylabel('Total counts')
plt.title('Report Chart')
plt.xticks(rotation=45)
plt.show()