3-D scatterplot
3-D scatterplot for three numeric fields in a box seen from an angle, with groups and sizes.
Use a 3-D scatterplot to show how groups of points separate along three numeric fields.
Gentoo penguins stand apart in bill depth and flipper length
Three measurements of 36 penguins, illustrative figures
AdelieChinstrapGentoo
This chart cannot be displayed here: it needs JavaScript and WebGL.
The same chart in each style
Source
```chart
type: scatter3d
title: Gentoo penguins stand apart in bill depth and flipper length
subtitle: Three measurements of 36 penguins, illustrative figures
data:
inline:
- {species: Adelie, bill_length: 38.3, bill_depth: 18.8, flipper: 189}
- {species: Adelie, bill_length: 36.9, bill_depth: 18.1, flipper: 196}
- {species: Adelie, bill_length: 40.9, bill_depth: 18.5, flipper: 192}
- {species: Adelie, bill_length: 35.5, bill_depth: 19.1, flipper: 193}
- {species: Adelie, bill_length: 35.4, bill_depth: 16.7, flipper: 186}
- {species: Adelie, bill_length: 39.4, bill_depth: 18.3, flipper: 193}
- {species: Adelie, bill_length: 39.4, bill_depth: 18.7, flipper: 187}
- {species: Adelie, bill_length: 39.9, bill_depth: 19.4, flipper: 187}
- {species: Adelie, bill_length: 38.1, bill_depth: 18.2, flipper: 193}
- {species: Adelie, bill_length: 37.9, bill_depth: 17.4, flipper: 187}
- {species: Adelie, bill_length: 37.2, bill_depth: 18.5, flipper: 192}
- {species: Adelie, bill_length: 38.9, bill_depth: 19.5, flipper: 180}
- {species: Chinstrap, bill_length: 48.6, bill_depth: 17.7, flipper: 198}
- {species: Chinstrap, bill_length: 45.9, bill_depth: 19.1, flipper: 199}
- {species: Chinstrap, bill_length: 51.7, bill_depth: 18.7, flipper: 197}
- {species: Chinstrap, bill_length: 50.0, bill_depth: 17.8, flipper: 194}
- {species: Chinstrap, bill_length: 46.9, bill_depth: 17.9, flipper: 202}
- {species: Chinstrap, bill_length: 45.9, bill_depth: 18.6, flipper: 203}
- {species: Chinstrap, bill_length: 45.0, bill_depth: 16.1, flipper: 198}
- {species: Chinstrap, bill_length: 46.6, bill_depth: 19.3, flipper: 202}
- {species: Chinstrap, bill_length: 49.3, bill_depth: 18.8, flipper: 204}
- {species: Chinstrap, bill_length: 49.8, bill_depth: 18.9, flipper: 188}
- {species: Chinstrap, bill_length: 50.7, bill_depth: 18.9, flipper: 186}
- {species: Chinstrap, bill_length: 50.5, bill_depth: 16.8, flipper: 195}
- {species: Gentoo, bill_length: 44.9, bill_depth: 16.4, flipper: 220}
- {species: Gentoo, bill_length: 48.1, bill_depth: 15.6, flipper: 218}
- {species: Gentoo, bill_length: 46.2, bill_depth: 14.6, flipper: 222}
- {species: Gentoo, bill_length: 45.7, bill_depth: 15.9, flipper: 224}
- {species: Gentoo, bill_length: 44.7, bill_depth: 14.9, flipper: 216}
- {species: Gentoo, bill_length: 50.3, bill_depth: 14.1, flipper: 223}
- {species: Gentoo, bill_length: 45.9, bill_depth: 15.6, flipper: 223}
- {species: Gentoo, bill_length: 48.2, bill_depth: 15.1, flipper: 218}
- {species: Gentoo, bill_length: 47.1, bill_depth: 15.2, flipper: 220}
- {species: Gentoo, bill_length: 49.0, bill_depth: 15.5, flipper: 227}
- {species: Gentoo, bill_length: 46.6, bill_depth: 14.7, flipper: 217}
- {species: Gentoo, bill_length: 46.8, bill_depth: 15.3, flipper: 226}
encoding: {x: bill_length, y: bill_depth, z: flipper, color: species}
axes:
x: {label: Bill length (mm)}
y: {label: Bill depth (mm)}
color: {label: Flipper (mm)}
```
Fields that matter
type: scatter3dwith numericencoding.x,encoding.yandencoding.z, an optionalencoding.colorthat splits the points into groups, an optionalencoding.sizeand an optionalencoding.labelfor the readout heading- Dots are drawn far to near; without
encoding.sizea nearer dot is larger and more opaque, with it the radius shows the size by area and only the opacity follows depth - Up to 80 points stand on a faint line to the floor so their position reads
- A chart takes at most 5,000 points; above that it is not drawn and
checkraiseschart.limit-exceedednaming the limit and the count style.azimuth(default 35) turns the view round the vertical axis andstyle.elevation(default 28) tilts it, both in degreesaxes.x,axes.yandaxes.colorname and format the three axes- A row without a coordinate or a group, or with a negative size, is left out and reported
Interactions
- Hover or focus a dot to read its three coordinates, its group and its size.
- Click a legend entry to remove a group and back.
- Open the Table view, Download PNG or CSV, or Expand the chart.