Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Plotly · Class

go.Splom

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.

How it works

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.

Syntax

go.Splom(arg=None, customdata=None, diagonal=None, **kwargs)

Parameters

NameTypeDescription
dimensionslist[dict]List of dictionaries; each dictionary supplies a dimension label and its values.
diagonal_visibleboolControls whether diagonal matrix cells are displayed.

Returns

A Plotly scatterplot-matrix trace object.

Key points

  • Put every variable in dimensions once; Plotly uses the collection to construct the matrix.
  • A dimension corresponds to one analyzed variable in the scatterplot matrix.
  • Set a dimension's label to control the axis titles shown for its matrix cells.
  • The trace is created as go.Splom(...) and can be passed to a go.Figure.
  • Use go.Splom when the higher-level Plotly Express interface is not a suitable starting point.

Common mistakes

  • Do not provide separate x and y arrays for every matrix cell; define the variables through dimensions instead.

Example: Basic scatterplot matrix

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.

When to use it

Inspect pairwise relationships

Exploratory analysis of several numeric variables.

Compare dimensions together

Preparing a compact interactive overview of correlated measurements.

Use the low-level graph-objects API

Customizing a matrix beyond a basic Plotly Express starting point.

Interview questions

QWhat is 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.

QHow are data supplied to a scatterplot matrix?

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.

QHow is the diagonal controlled?

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_objects
  • go.Figure
  • dimensions
  • diagonal_visible
  • Plotly Express

Source: Scatterplot matrix in Python - Plotly. Checked 2026-10-15.