0
fig, (ax1, ax2) = plt.subplots(1,2)
sns.catplot(x = "XVariable1", y = "YVariable", data = df, ax=ax1)
sns.catplot(x = "XVariable2", y = "YVariable", data = df, ax=ax2)
plt.show()

The code does display the categorical plots but only beneath, and then have two empty plots next to each above. Notice the X-variables are different.

  • use `sns.stripplot(...., ax=ax1)`. `sns.catplot` is a figure-level plot, which creates a `FacetGrid`, and does not have an `ax` parameter, as explained in the duplicate. – Trenton McKinney May 05 '22 at 05:01

0 Answers0