简体   繁体   中英

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

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 ?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM