0

I'm plotting, through seaborn, two ecdf distplots of two variables (varA and varB) through this code:

a=sns.displot(data=doc_topic_df, x="varA", kind="ecdf")
b=sns.displot(data=doc_topic_df, x="varB", kind="ecdf")

I receive this output:

enter image description here

But I would like to have a single plot with shared axis, in a way like this:

enter image description here

How can I do?

Himan
  • 39
  • 4
  • 2
    `displot` is a figure-level function. You can directly call the underlying axis-level functions. `ax = sns.ecdfplot(data=doc_topic_df, x="varA")` and `sns.ecdfplot(data=doc_topic_df, x="varB", ax=ax)`. See [Similar functions for similar tasks](https://seaborn.pydata.org/tutorial/function_overview.html#similar-functions-for-similar-tasks) – JohanC Apr 06 '22 at 11:58

0 Answers0