I have a pandas df which I would like to plot in a displot with seaborn. I have a variable to plot, A, and a variable to hue, B. The problem is that the B variable has ca. 50 different values, so I would like to automatically create a grid of each subplots, say 5 columns and the neccessary number of rows.
Right now I can only put the plots in row or columns, with:
sns.displot(data=df, x="A", col="B")
or
sns.displot(data=df, x="A", row="B")
Is there a way to achieve the desired result?
Are you looking for
col_wrap
?Output :
Input used :