1

I use the following to create my subplots

fig, axs = plt.subplots(2,2)
sns.plotfunc(..., ax = axs[0])

but, the pairplot function in seaborn does not support the ax augment, any idea how to plot it as subplot?

Thanks in advance.

1

2 Answers 2

2

You can use Seaborn's PairGrid to plot multiple pairplots like this:

g = sns.PairGrid(df, y_vars=['variable_a','variable_b'], x_vars=["variable_c", "variable_d"], height=4)
g.map(sns.regplot)
plt.show()

Another example on how to use PairGrid can be found here.

Sign up to request clarification or add additional context in comments.

Comments

0

Actually, if I passed plt.subplots(2, 2), it will return 2*2 array, thus I should use sns.plotfunc(..., ax = axs[0][1]), instead

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.