Plot.plot({
width,
marks: [
Plot.ruleY([0]),
Plot.lineY(withnoise, { opacity: 0.1, y: "value" }),
Plot.ruleY(
[
{ label: "rms", value: rms },
{ label: "mean", value: mean },
{ label: "root mean", value: rootMean },
{ label: "harmonic mean", value: harmonicMean }
],
{ stroke: "label", y: "value" }
)
],
color: { type: "categorical", legend: true }
})