Anscombe’s quartet

The facet plot option is an alternative to the fx and fy mark options. It is useful when multiple marks share the same data, such as the line and dot marks below.

Plot.plot({
  grid: true,
  aspectRatio: 0.5,
  facet: {data: anscombe, x: "series"},
  marks: [
    Plot.frame(),
    Plot.line(anscombe, {x: "x", y: "y"}),
    Plot.dot(anscombe, {x: "x", y: "y"})
  ]
})
const anscombe = FileAttachment("data/anscombe.csv").csv({typed: true}).then(display);
✎ Suggest changes to this page