Using binX (using the mean reducer) with line plot

Looks like you’re just missing the y: "number" for the line to tell the bin transform what values to reduce.

Plot.plot({
  marks: [
    Plot.lineY(data, Plot.binX({ y: "mean" }, { x: "weight", y: "number", z: "year" }))
  ]
})

https://observablehq.com/d/29ddba1365891c01

1 Like