Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

SPLOM diagonals #42

Open
nicolaskruchten opened this issue Apr 3, 2019 · 18 comments
Open

SPLOM diagonals #42

nicolaskruchten opened this issue Apr 3, 2019 · 18 comments

Comments

@nicolaskruchten
Copy link
Member

from https://community.plot.ly/t/plotly-express-scatterplot-matrix-diagonal/21464

Is it somehow possible to set the diagonal of the scatterplot matrix in plotly express to a histogram like in pandas? And even more better like seaborns pairgrid a stack histogram with its argument hue? Would be really nice.

@alexcjohnson
Copy link
Collaborator

Would love this to be built in at the plotly.js level. From plotly/plotly.js#2555:

Things we could do, but would require some thought

  • Add sub-trace on the diagonal (e.g. with diagonal.mode: 'scattergl' || 'histogram' || 'box' || 'violin', see #2505 (comment)

@nicolaskruchten
Copy link
Member Author

Yeah we definitely need this baked in at the JS level! I'd want brushing to match, meaning if I lasso-select some points, I'd see "part of" the diagonal being selected somehow. Easy with histograms (just shade part of the bar) but harded with box/violin.

I'd also love to be able to have contours in the upper triangle and points in the lower triangle, or something like that. Brushing in that case seems very challenging though:

image

@alexcjohnson
Copy link
Collaborator

Ah yeah, contours on one triangle would be cool! One easy way to handle brushing in that case would be to just use the coordinates of the outline to select the corresponding points as though the display was scatter. On the diagonal I guess brushing should be limited to 1D regardless of the display mode.

@nicolaskruchten
Copy link
Member Author

Oh no I mean the other way: if you select some blob-shaped assortment of points in a scatter subplot, how do you render the contours/histogram/boxes?

@alexcjohnson
Copy link
Collaborator

Ah I see. For all the diagonal options I feel like we can make a separate "filtered" trace - so a second histogram inside the first, a separate violin/box next to the first.

Definitely tricky for contours though... it's hard to make two overlaid contour plots useful. So either we just plot contours of the selected data, or perhaps faded black & white contours of the full data set with semi-transparent contours in color on top of it, kind of like parcoords

@nicolaskruchten
Copy link
Member Author

Something like that, yep

@wlievens
Copy link

This would be really neat, is anything like this planned?

@grisaitis
Copy link

Is this not possible with graph_objects.Splom?

@nicolaskruchten
Copy link
Member Author

@grisaitis not yet! Plotly Express uses graph_objects.Splom under the hood so if it were possible there we'd have it in PX as well already :)

@grisaitis
Copy link

Ok so the roadblock is that the main dependency doesn't support this. Do we know of an open issue in plotly/plotly about this?

@nicolaskruchten
Copy link
Member Author

Yep: plotly/plotly.js#2555

@ChristianMichelsen
Copy link

Any news on this? Coming from a data science background, this seems like a very common plot that would be super useful for EDA!

@InCogNiTo124
Copy link

Bump for histograms on the diagonals

@dragoljub
Copy link

👍 Would love to see this too!

@rsgoodwin
Copy link

@nicolaskruchten - I really like your suggestion. Would be very nice to have this as a feature.

@milanzmitrovic
Copy link

Hi all,

This would be wunderful to have in Plotly express. Charts like this are really workhorse when presenting classification algorithms.

Seaborn has similar algo implemented https://seaborn.pydata.org/examples/scatterplot_matrix.html . It is kind of shame for Plotly not to have sth like that already implemented.

I saw similar implementation in figure factory, but ff seems not to be maintained anymore, correct me if I am wrong?

@UpstatePedro
Copy link

Is there any update on this?

@hughjward
Copy link

While not using px it is possible with the figure factory, as a workaround until this is added to px:
ff.create_scatterplotmatrix

using the diag='histogram' option.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests