New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sharex not working with displot? #2557
Comments
Duplicate of #2553 |
Thanks for pointing this out @mwaskom , sorry about that. However, the use of And my situation is actually more similar to the following one, where I also have different rows: import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
titanic = sns.load_dataset("titanic")
df = pd.melt(titanic, id_vars=["sex", "class"], value_vars=["fare", "age"])
sns.displot(
data=df,
x="value",
col="variable",
row="class",
hue="sex",
facet_kws={"sharex": False, "sharey": False},
common_bins=False,
)
plt.savefig("test.png") Is there a way to share bins across |
Well you can set the bin width you want to use, but for a deeper level of facet-specific parameterization you're going to need to use |
Ok, I'll try that. Thanks! |
@mwaskom I've been using |
Hi @RMeli hard to advise without seeing code for your current solution. Could you make a reproducible example and ask on StackOverflow? It's an interesting task. Thanks. |
I was about to post some code yesterday but realized it was quite similar to the code above, I think I'm running in circles... I'll post on StackOverflow, thanks. |
For future reference: share histogram bins across columns - StackOverflow |
I am trying to use
displot
to plot distributions of different variables in the same figure. I might be usingdisplot
incorrectly, but it seems to me that thesharex
option passed tofacet_kws
is not working correctly (whilesharey
does work as expected).Simple code snippet to reproduce:
The result is the following:
As you can see, the
y
axes have different values, while thex
axes seem to be shared despite the"sharex": False
keyword.The text was updated successfully, but these errors were encountered: