I am trying to subplot multiple curves and show the percentile for each subset. however, with my current code it only plots the percentile of the whole dataset, not for each sample.
Code:
sns.set_theme()
grid = sns.FacetGrid(hist, col='Region', height=4.3, sharey=False, sharex=False, margin_titles=False, row= 'Surname')
grid = grid.map(sns.histplot, 'Age',kde=True)
def vertical_mean_line_survived(x, **kwargs):
Q1=np.percentile(hist['Age'], 10)
Q2=np.percentile(hist['Age'], 90)
plt.axvline(Q1, color='r', linestyle='--')
plt.axvline(Q2, color='r', linestyle='--')
grid.map(vertical_mean_line_survived, 'Age')
grid.fig.subplots_adjust(top=0.8)
plt.subplots_adjust(hspace=0.4)
Thank you!!