I'm trying to plot a distribution data, where the most values in this list are close to one number (and therefore are in the same bin) and some values are close to a different number. So the histogram looks like there is one or two huge bins/bars and one or two small one, which are barely visible. What is want to do, is to highlight the bins that have actually data in it. I would like to do it using labels. So in my example I want only have labels for the bin with the "1"s and for the bin with the "10", where I want to display the amount of values that are in this bin. That is especially helpful for the bin with the "10" because its barely visible compared to the bin with the "1"s. Can anyone give me a hint?
data_list = [1, 1, 1, 1, 1, 1, 10]
number_of_bins = int(len(set(data_list)))
ax = plt.subplot()
(n, bins, patches) = ax.hist(data_list, histtype='bar', bins=number_of_bins, edgecolor="black")
plt.show()