I spent few hours seeing if I could replicate sns.pairplot with plotly in an easy way, but is problem after problem.
I gave up on try to do the histogram on the diagonal because I saw that is a work in progress (https://github.com/plotly/plotly_express/issues/42).
In seaborn I used:
and I got in 16s:
In plotly after deciding not to use ff.create_scatterplotmatrix() because is deprecated and also need to play with the width and height, I tried with plotly express and got in 66ms:
Then I had to start playing with the size and the marker size because the points were too big to see the distribution, and I got this in 72ms:
fig = px.scatter_matrix(data[numeric_cols], height=800, width=800) fig.update_traces(marker=dict(size=1, line=dict(width=1, color="DarkSlateGrey"))) fig.update_traces(diagonal_visible=False) fig.show()
But still the axis labels are impossible to handle, I tried with
fig.update_xaxes(tickangle=45) but it only works for the labels inside, and only the first graph. And even if works maybe it will not work for all axis.
So, my question is if there are some automatic way to fix the size without needing to start trying different width/height, axis labels not overlapping… or what is the best hotfix?
EDIT: Btw if someone wants to replicate the dataset is a modified version of https://www.kaggle.com/unsdsn/world-happiness