Inspect pairwise relationships
Exploratory analysis of several numeric variables.
Plotly · Class
go.Splom creates an interactive scatterplot matrix from multiple variables. Provide each variable once through dimensions, rather than defining separate x/y data for every pair.
go.Splom is a specialized Plotly trace for scatterplot matrices. Supply each variable once in dimensions; Plotly derives pairwise cells from those arrays instead of requiring separate x/y data for every cell.
go.Splom(arg=None, customdata=None, diagonal=None, **kwargs)| Name | Type | Description |
|---|---|---|
dimensions | list[dict] | List of dictionaries; each dictionary supplies a dimension label and its values. |
diagonal_visible | bool | Controls whether diagonal matrix cells are displayed. |
A Plotly scatterplot-matrix trace object.
dimensions once; Plotly uses the collection to construct the matrix.label to control the axis titles shown for its matrix cells.go.Splom(...) and can be passed to a go.Figure.go.Splom when the higher-level Plotly Express interface is not a suitable starting point.dimensions instead.import plotly.graph_objects as go
fig = go.Figure(go.Splom(
dimensions=[
dict(label="sepal length", values=[5.1, 4.9, 4.7]),
dict(label="sepal width", values=[3.5, 3.0, 3.2]),
dict(label="petal length", values=[1.4, 1.4, 1.3]),
],
diagonal_visible=False,
))
fig.show()Creates a scatterplot matrix from three variables, using each dimension's label for the corresponding axes and hiding the diagonal cells.
Exploratory analysis of several numeric variables.
Preparing a compact interactive overview of correlated measurements.
Customizing a matrix beyond a basic Plotly Express starting point.
go.Splom used for?go.Splom is a generic graph-objects class that creates a scatterplot matrix. Its dimensions contain the variables, and Plotly generates the pairwise scatter plots from them.
Follow-up: How would you provide the variables? Pass a list of dictionaries, each containing a dimension label and its values.
Pass each array once in the dimensions list. Each dictionary represents one variable, and its label becomes the corresponding axes title.
Follow-up: Why is this preferable to separate x/y inputs? It avoids repeating the same variable for every pair of matrix cells.
The diagonal is visible by default and can be hidden with diagonal_visible=False. The diagonal does not accept an arbitrary Plotly trace.
Follow-up: Can a histogram or box plot be inserted into a diagonal cell? Not with go.Splom; use another approach such as a figure-factory scatterplot matrix if that layout is required.
plotly.graph_objectsgo.Figuredimensionsdiagonal_visiblePlotly Express