Is there a way to efficiently construct a pairplot in the new seaborn.objects as with seaborn.pairplot?

Question:

I just started digging into the new seaborn.objects interface, which I liked pretty much. Though seaborn.pairplot works fine for me, I have stumbled upon trying to make a nice lower-triangle pairplot with seaborn.objects.Plot.pair.

Square layout comes out easily, though I don’t know if it’s possible to change the diagonal plots to KDEs or histograms:

import matplotlib as mpl
import seaborn.objects as so

f = mpl.figure.Figure(figsize=(10, 10),
                      tight_layout=True)

(
 so
   .Plot(df)
   .pair(x=['col1', 'col2', 'col3', 'col4', 'col5'],
         y=['col1', 'col2', 'col3', 'col4', 'col5'],
         cross=True)
   .add(
 so
   .Dot())
   .on(f)
   .plot()
)

I guess it could be solved with a complicated loop-over or a detailed subplot solution, but is there a way to do this in a short and easy manner that isn’t the good old seaborn.pairplot?

Asked By: n.shabankin

||

Answers:

Currently (as of v0.12.0) there’s not support for the upper/lower/diagonal concepts from PairGrid in Plot.pair.

Answered By: mwaskom
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.