I wrote the following code in order to plot a 2x2 displot with seaborn:
df = pd.DataFrame(
{'Re' : x,
'n' : y,
'Type' : tp,
'tg' : tg,
'gt' : gt
})
g = sns.FacetGrid(df, row='gt', col='tg', margin_titles=False, height=2.5, aspect=1.65)
g.map(sns.displot(df, x='Re', y='n', hue='Type', kind='kde',log_scale=True, palette=customPalette, fit_reg=False, x_jitter=.1))
However I get this error that I cannot fix:
func(*plot_args, **plot_kwargs)
TypeError: 'FacetGrid' object is not callable
The x, y, tp, tg and gt imported in the df are lists.
Does anyone have any clue what I might do to fix this? Thank you in advance! :)
*This is how the df looks like: [1]: https://i.stack.imgur.com/H6J9c.png