@eyebp figure_factory provides a method for creating scatterplot matrix, that unlike splom, can plot on diagonal a histogram or a boxplot. Unfortunately it isn’t maintained, and running the code below you’ll see deprecation warning.
But even with these warnings you can insert on diagonal the desired trace type.
First you should inspect fig.data (eventually fig.layout, too) to extract the data index corresponding to traces on the diagonal, and then remove these traces.
With fig.add_trace(trace, row=k, col=k) you can add a new trace on each diagonal cell.
import plotly.graph_objects as go
import plotly.figure_factory as ff
import numpy as np
import pandas as pd
df = pd.DataFrame(np.random.randn(20, 4),
columns=['Column A', 'Column B', 'Column C', 'Column D'])
df['Fruit'] = pd.Series(['apple', 'apple', 'grape', 'apple', 'apple',
'grape', 'pear', 'pear', 'apple', 'pear',
'apple', 'apple', 'grape', 'apple', 'apple',
'grape', 'pear', 'pear', 'apple', 'pear'])
fig = ff.create_scatterplotmatrix(df, diag='histogram', index='Fruit',
height=800, width=800)
