Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Seaborn displot facetgrid do not share y axis

I'm trying to make a grid of seaborn displots, using the built-in row/col arguments within the plotting function.

However, I have a high variance in the values for some of my rows and cols, and the default is to share an x/y axis.

I need to figure out where to put sharey = False and sharex = False. I can't pass them into sns.displot directly, and if I try and make a figure beforehand, it doesn't get incorporated into the displot object.

So in this example below, I need the second row to be scaled to have a maximum ~0.5, not 0.7 like the plot in (0,1), that's impacting the y axis scale of all the plots below.

Minimal reproducible example

tips = sns.load_dataset("tips")
plt.figure(figsize = (6, 6))
sns.displot(tips, x = "tip", multiple = "stack", kind = "kde", bw_adjust=.3, common_norm = False, col = "sex", row = "time")
like image 290
wiscoYogi Avatar asked Dec 15 '25 05:12

wiscoYogi


1 Answers

Use facet_kws (e.g. facet_kws=dict(sharey=False))

like image 152
mwaskom Avatar answered Dec 16 '25 19:12

mwaskom



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!