Skip to content

Splom

Overview

The splom trace type is used to create scatter plot matrices, which are useful for visualizing pairwise relationships between multiple variables. A scatter plot matrix shows scatter plots for each pair of variables, making it a great tool for exploring correlations and patterns in multi-dimensional data.

You can customize the marker size, color, and lines, similar to scatter plots, but for each pair of variables in the matrix.

Common Uses

  • Pairwise Relationship Analysis: Exploring relationships between multiple variables simultaneously.
  • Correlation Visualization: Identifying patterns, clusters, or outliers in high-dimensional datasets.
  • Multivariate Data Exploration: Useful in statistics, machine learning, and data science for analyzing multiple variables at once.

Check out the Attributes for the full set of configuration options

Examples

Common Configurations

Here's a simple splom plot showing pairwise scatter plots between four variables:

You can copy this code below to create this chart in your project:

models:
  - name: splom-data
    args:
      - curl
      - "-s"
      - "https://raw.githubusercontent.com/visivo-io/data/refs/heads/main/iris.csv"
traces:
  - name: Simple Splom Plot
    model: ${ref(splom-data)}
    cohort_on: species
    props:
      type: splom
      dimensions:
        - label: "Sepal Length"
          values: ?{sepal_length}
        - label: "Sepal Width"
          values: ?{sepal_width}
        - label: "Petal Length"
          values: ?{petal_length}
        - label: "Petal Width"
          values: ?{petal_width}
      diagonal:
        visible: false
      showupperhalf: false
charts:
  - name: Simple Splom Chart
    traces:
      - ${ref(Simple Splom Plot)}
    layout:
      title:
        text: Simple Splom Plot<br><sub>Scatter Plot Matrix of Four Variables & Three Cohorts</sub>

This example demonstrates a splom plot where different colors represent different categories:

Here's the code:

models:
  - name: splom-data-colors
    args:
      - echo
      - |
        var1,var2,var3,category
        1,2,3,A
        2,3,4,B
        3,4,5,A
        4,5,6,B
        5,6,7,A
traces:
  - name: Splom Plot with Custom Colors
    model: ${ref(splom-data-colors)}
    props:
      type: splom
      dimensions:
        - label: "Variable 1"
          values: ?{var1}
        - label: "Variable 2"
          values: ?{var2}
        - label: "Variable 3"
          values: ?{var3}
      marker:
        color: ?{case when category = 'A' THEN 'red' else 'green' end}
        size: 20
charts:
  - name: Splom Chart with Custom Colors
    traces:
      - ${ref(Splom Plot with Custom Colors)}
    layout:
      title:
        text: Splom Plot with Custom Colors<br><sub>Color-Coded Scatter Plot Matrix</sub>

Here's a splom plot where marker sizes are customized based on a fourth variable:

Here's the code:

models:
  - name: splom-data-sizes
    args:
      - echo
      - |
        var1,var2,var3,size
        1,2,3,10
        2,3,4,15
        3,4,5,20
        4,5,6,25
        5,6,7,30
traces:
  - name: Splom Plot with Custom Sizes
    model: ${ref(splom-data-sizes)}
    props:
      type: splom
      dimensions:
        - label: "Variable 1"
          values: ?{var1}
        - label: "Variable 2"
          values: ?{var2}
        - label: "Variable 3"
          values: ?{var3}
      marker:
        size: ?{size}
charts:
  - name: Splom Chart with Custom Sizes
    traces:
      - ${ref(Splom Plot with Custom Sizes)}
    layout:
      title:
        text: Splom Plot with Custom Sizes<br><sub>Scatter Plot Matrix with Custom Marker Sizes</sub>

A schema to validate plotly trace properties

Attributes

These attributes apply to traces where trace.props.type is set to splom. You would configure these attributes on the trace with the trace.props object.

customdata: array
customdatasrc: 'string' #(1)!
diagonal:
  visible: boolean
dimensions: array
hoverinfo: array
hoverinfosrc: 'string' #(2)!
hoverlabel:
  align: array
  alignsrc: 'string' #(3)!
  bgcolor: array
  bgcolorsrc: 'string' #(4)!
  bordercolor: array
  bordercolorsrc: 'string' #(5)!
  font:
    color: array
    colorsrc: 'string' #(6)!
    family: 'string | array' #(7)!
    familysrc: 'string' #(8)!
    lineposition: array
    linepositionsrc: 'string' #(9)!
    shadow: 'string | array' #(10)!
    shadowsrc: 'string' #(11)!
    size: array
    sizesrc: 'string' #(12)!
    style: array
    stylesrc: 'string' #(13)!
    textcase: array
    textcasesrc: 'string' #(14)!
    variant: array
    variantsrc: 'string' #(15)!
    weight: array
    weightsrc: 'string' #(16)!
  namelength: array
  namelengthsrc: 'string' #(17)!
hovertemplate: 'string | array' #(18)!
hovertemplatesrc: 'string' #(19)!
hovertext: 'string | array' #(20)!
hovertextsrc: 'string' #(21)!
ids: array
idssrc: 'string' #(22)!
legend: string
legendgroup: 'string' #(23)!
legendgrouptitle:
  font:
    color: any
    family: 'string' #(24)!
    lineposition: any
    shadow: 'string' #(25)!
    size: number
    style: any
    textcase: any
    variant: any
    weight: integer
  text: 'string' #(26)!
legendrank: number
legendwidth: number
marker:
  angle: array
  anglesrc: 'string' #(27)!
  autocolorscale: boolean
  cauto: boolean
  cmax: number
  cmid: number
  cmin: number
  color: array
  coloraxis: string
  colorbar:
    bgcolor: any
    bordercolor: any
    borderwidth: number
    exponentformat: any
    len: number
    lenmode: any
    minexponent: number
    nticks: integer
    orientation: any
    outlinecolor: any
    outlinewidth: number
    separatethousands: boolean
    showexponent: any
    showticklabels: boolean
    showtickprefix: any
    showticksuffix: any
    thickness: number
    thicknessmode: any
    tickangle: number
    tickcolor: any
    tickfont:
      color: any
      family: 'string' #(28)!
      lineposition: any
      shadow: 'string' #(29)!
      size: number
      style: any
      textcase: any
      variant: any
      weight: integer
    tickformat: 'string' #(30)!
    tickformatstops: array
    ticklabeloverflow: any
    ticklabelposition: any
    ticklabelstep: integer
    ticklen: number
    tickmode: any
    tickprefix: 'string' #(31)!
    ticks: any
    ticksuffix: 'string' #(32)!
    ticktext: array
    ticktextsrc: 'string' #(33)!
    tickvals: array
    tickvalssrc: 'string' #(34)!
    tickwidth: number
    title:
      font:
        color: any
        family: 'string' #(35)!
        lineposition: any
        shadow: 'string' #(36)!
        size: number
        style: any
        textcase: any
        variant: any
        weight: integer
      side: any
      text: 'string' #(37)!
    x: number
    xanchor: any
    xpad: number
    xref: any
    y: number
    yanchor: any
    ypad: number
    yref: any
  colorscale: any
  colorsrc: 'string' #(38)!
  line:
    autocolorscale: boolean
    cauto: boolean
    cmax: number
    cmid: number
    cmin: number
    color: array
    coloraxis: string
    colorscale: any
    colorsrc: 'string' #(39)!
    reversescale: boolean
    width: array
    widthsrc: 'string' #(40)!
  opacity: array
  opacitysrc: 'string' #(41)!
  reversescale: boolean
  showscale: boolean
  size: array
  sizemin: number
  sizemode: any
  sizeref: number
  sizesrc: 'string' #(42)!
  symbol: array
  symbolsrc: 'string' #(43)!
metasrc: 'string' #(44)!
name: 'string' #(45)!
opacity: number
selected:
  marker:
    color: any
    opacity: number
    size: number
showlegend: boolean
showlowerhalf: boolean
showupperhalf: boolean
stream:
  maxpoints: number
  token: 'string' #(46)!
text: 'string | array' #(47)!
textsrc: 'string' #(48)!
type: splom
uid: 'string' #(49)!
unselected:
  marker:
    color: any
    opacity: number
    size: number
visible: any
xaxes: array
xhoverformat: 'string' #(50)!
yaxes: array
yhoverformat: 'string' #(51)!
  1. Sets the source reference on Chart Studio Cloud for customdata.
  2. Sets the source reference on Chart Studio Cloud for hoverinfo.
  3. Sets the source reference on Chart Studio Cloud for align.
  4. Sets the source reference on Chart Studio Cloud for bgcolor.
  5. Sets the source reference on Chart Studio Cloud for bordercolor.
  6. Sets the source reference on Chart Studio Cloud for color.
  7. HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
  8. Sets the source reference on Chart Studio Cloud for family.
  9. Sets the source reference on Chart Studio Cloud for lineposition.
  10. Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
  11. Sets the source reference on Chart Studio Cloud for shadow.
  12. Sets the source reference on Chart Studio Cloud for size.
  13. Sets the source reference on Chart Studio Cloud for style.
  14. Sets the source reference on Chart Studio Cloud for textcase.
  15. Sets the source reference on Chart Studio Cloud for variant.
  16. Sets the source reference on Chart Studio Cloud for weight.
  17. Sets the source reference on Chart Studio Cloud for namelength.
  18. Template string used for rendering the information that appear on hover box. Note that this will override hoverinfo. Variables are inserted using %{variable}, for example "y: %{y}" as well as %{xother}, {%xother}, {%_xother}, {%xother_}. When showing info for several points, xother will be added to those with different x positions from the first point. An underscore before or after (x|y)other will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in hovertemplate are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are arrayOk: true) are available. Anything contained in tag <extra> is displayed in the secondary box, for example "{fullData.name}". To hide the secondary box completely, use an empty tag <extra></extra>.
  19. Sets the source reference on Chart Studio Cloud for hovertemplate.
  20. Same as text.
  21. Sets the source reference on Chart Studio Cloud for hovertext.
  22. Sets the source reference on Chart Studio Cloud for ids.
  23. Sets the legend group for this trace. Traces and shapes part of the same legend group hide/show at the same time when toggling legend items.
  24. HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
  25. Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
  26. Sets the title of the legend group.
  27. Sets the source reference on Chart Studio Cloud for angle.
  28. HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
  29. Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
  30. Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format. And for dates see: https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format. We add two items to d3's date formatter: %h for half of the year as a decimal number as well as %{n}f for fractional seconds with n digits. For example, 2016-10-13 09:15:23.456 with tickformat %H~%M~%S.%2f would display 09~15~23.46
  31. Sets a tick label prefix.
  32. Sets a tick label suffix.
  33. Sets the source reference on Chart Studio Cloud for ticktext.
  34. Sets the source reference on Chart Studio Cloud for tickvals.
  35. HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
  36. Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
  37. Sets the title of the color bar.
  38. Sets the source reference on Chart Studio Cloud for color.
  39. Sets the source reference on Chart Studio Cloud for color.
  40. Sets the source reference on Chart Studio Cloud for width.
  41. Sets the source reference on Chart Studio Cloud for opacity.
  42. Sets the source reference on Chart Studio Cloud for size.
  43. Sets the source reference on Chart Studio Cloud for symbol.
  44. Sets the source reference on Chart Studio Cloud for meta.
  45. Sets the trace name. The trace name appears as the legend item and on hover.
  46. The stream id number links a data trace on a plot with a stream. See https://chart-studio.plotly.com/settings for more details.
  47. Sets text elements associated with each (x,y) pair to appear on hover. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates.
  48. Sets the source reference on Chart Studio Cloud for text.
  49. Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
  50. Sets the hover text formatting rulefor x using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format. And for dates see: https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format. We add two items to d3's date formatter: %h for half of the year as a decimal number as well as %{n}f for fractional seconds with n digits. For example, 2016-10-13 09:15:23.456 with tickformat %H~%M~%S.%2f would display 09~15~23.46By default the values are formatted using xaxis.hoverformat.
  51. Sets the hover text formatting rulefor y using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format. And for dates see: https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format. We add two items to d3's date formatter: %h for half of the year as a decimal number as well as %{n}f for fractional seconds with n digits. For example, 2016-10-13 09:15:23.456 with tickformat %H~%M~%S.%2f would display 09~15~23.46By default the values are formatted using yaxis.hoverformat.