I am trying to draw a vertical line to a density plot from seaborn, and I want this line to reach the respective y-value at the curve. What I've tried:
np.random.seed(1)
a=np.random.normal(size=1000)
sns.kdeplot(a)
x, y = sns.kdeplot(a).get_lines()[0].get_data()
f = np.interp(1,x, y)
plt.axvline(1, ymax=f);
As you can see the result was not as desirable. I want the vertical line to reach the curve. What am I doing wrong?