I am trying to find the y coordinate, for the bars on the top so that i can add the percentages at the top. Here is the code and the output i am getting.
ax = sns.histplot(x='bmi', hue='stroke', data=df, multiple='stack', binwidth=2.5, binrange=(15,52.5))
for i in range(15):
x= ax.patches[i+15].get_x()
y=ax.patches[i+15].get_y()
ax.annotate("{:.1f}%".format(bmi_perc[i]), xy=(x,y))
I tried to change the indices of the patches, but they all end up giving height of the bars at the bottom.

