question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hybrid PairGrid/FacetGrid?

See original GitHub issue

I am a really big fan of FacetGrid and the new PairPlot.

One sort of plot that I often like to create involves columns for different variables (e.g., a PairGrid) and rows for different values of single variable (e.g., a FacetGrid).

It would be nice for Seaborn to support these sort of “hybrid” Pair/Facet grids natively. You could even identify which is the case for each aesthetic automatically (likely in a new class) simply by whether the input arguments are strings (e.g., hue='species') or list-like (e.g., hue=['temperature', 'precipitation']).

My current work around is to use turn the different variables into a single variable via DataFrame.stack() and then use FacetGrid, but this is awkward (the axis labels require some manual fixes).

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
nmusolinocommented, Aug 29, 2017

Here is a StackOverflow question asking how to do exactly this: https://stackoverflow.com/questions/30623721/plot-multiple-dataframe-columns-in-seaborn-facetgrid

0reactions
mwaskomcommented, May 24, 2022

This has been implemented in the objects interface for (experimental) release in v0.12:

(
    so.Plot(penguins, x="body_mass_g", color="species")
    .pair(y=["bill_length_mm", "bill_depth_mm"])
    .facet(col="sex")
    .add(so.Scatter())
)
image

I think it’s unlikely that this will appear as a standalone class ala PairGrid/FacetGrid … one never knows, but for now I’m going to call this completed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

seaborn.PairGrid — seaborn 0.12.1 documentation - PyData |
Easily drawing common uses of PairGrid . FacetGrid. Subplot grid for plotting conditional relationships. Examples. Calling the constructor sets up a blank grid ......
Read more >
Reshape subplots on a Seaborn PairGrid - Stack Overflow
I really like the functionality of Seaborn's PairGrid. However, I haven't been able to reshape the subplots to my satisfaction.
Read more >
Python Data Science Handbook
A third indexing attribute, ix, is a hybrid of the two, ... We'll do this using a pairgrid, which draws plots of all...
Read more >
Audi-Car-Analysis | Kaggle
Audi Car have 3 Fuel Type Petrol, Diesel and Hybrid electric. In [11]: ... PairGrid at 0x7f232f54aa90>. In [22]: ... FacetGrid at 0x7f232deac950>....
Read more >
Introduction to machine learning - Microsoft Open Source
This type of system is actually hybrid, consisting partially of a rules engine ... Create such a grid by instantiating a PairGrid ,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found