How would I go about adding a horizontal line to this histogram? I have tried the usual methods (that work with bar graphs) however the line does not plot due to the y axis being in terms of percentage (I assume). I am trying to plot a line that exists from hour (x cord) 11 until hour (x cord) 22 in order to portray a change in experimental conditions. Anyone know what to do? Thanks!
probability_list = np.array(probability_list, dtype=float)
x = 24
f, ax = plt.subplots(1, 1, figsize=(10, 5))
heights, bins = np.histogram(probability_list, bins=len(list(set(probability_list))))
percent = [i / len(dayammount) * 100 for i in heights]
ax.bar(bins[:-1], percent, width=.025, align="edge")
vals = ax.get_yticks()
ax.set_yticklabels(['%1.2f%%' % i for i in vals])
plt.xlim(xmin=0, xmax=24)
plt.xticks(range(0, 25))
plt.xlabel('Time (Hours)')
plt.ylabel('Probability of Sound (%)')
plt.show()