i just want to add the percent values to the tops of the bars in my matplotlib histogram. This is what I have so far. Any ideas on how to do this? I know there are similar posts, but I only saw stuff on horizontal bars or seaborn plots. Thanks!
x = [2.5, 10.4, 0.5, 1.2, 4.6, 3.6, 0.8, 2.5, 2.9, 1.6, 9.4, 4.9, 2.6, 4.2, 3.9]
myplot = plt.hist(x, bins = [0,1,2,3,10],weights=np.ones(len(x)) / len(x))
plt.gca().yaxis.set_major_formatter(PercentFormatter(1))
total = float(len(x))
plt.show()