How to create splom graph with different x and y dimensions


I’m trying to create a splom graph where the x axes are different from the y axis eg. column A and B of a dataframe on x-axis and column C and D on y axis to observe cross-correlations.
In my understanding, the ‘xaxes’ and ‘yaxes’ keywords are used for this purpose. However what I tried so far does not work:

import numpy as np
import pandas as pd
import as px

df = pd.DataFrame(np.array([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]]),
                   columns=['A', 'B', 'C', 'D'])

fig = px.scatter_matrix(data_frame=df, dimensions=['A', 'B', 'C', 'D'] )

fig.update_traces( xaxes=['x1', 'x2'], yaxes=['y3', 'y4'])

This code results in no plot, but if I use just one of the xaxes/yaxes keywords, only the first two dimensions show up in the plot.

My guess is I’m interpreting the use of ‘xaxes’ and ‘yaxes’ incorrect but the documentation does not really help.
I’m thankfull for any hint.


Hi everybody,
the same problem occurs here in an R environment:
####start R source code

df ← read.csv(‘’)

pl_colorscale=list(c(0.0, ‘#19d3f3’),
c(0.333, ‘#19d3f3’),
c(0.333, ‘#e763fa’),
c(0.666, ‘#e763fa’),
c(0.666, ‘#636efa’),
c(1, ‘#636efa’))

axis = list(showline=FALSE,

dimensions = list(
list(label=‘sepal length’, values=~sepal.length),
list(label=‘sepal width’, values=~sepal.width),
list(label=‘petal length’, values=~petal.length),
list(label=‘petal width’, values=~petal.width))

fig ← df %>%
fig ← fig %>%
type = ‘splom’,
dimensions = dimensions,
marker = list(
color = as.integer(df$class),
colorscale = pl_colorscale,
size = 7,
line = list(
width = 1,
color = ‘rgb(230,230,230)’

xaxes = dimensions[3:4], #only xaxes or yaxes as dimensions works, both at the same time will produce no plot

yaxes = dimensions[1:2]


####end R source code
Maybe this is an error in the plotly package? I would like to see a solution for this.