Plot.plot({
style: { fontSize: 16 },
marginBottom: 50,
marginTop: 40,
width: width,
height: 800,
fx: { axis: null },
fy: { axis: null },
x: { grid: true, domain: [2, 21] },
y: { grid: true, domain: [2, 14] },
marks: [
Plot.frame({ strokeOpacity: 1 }),
Plot.dot(data, {
fx: (d) => niceFx(d.class),
fy: (d) => niceFy(d.class),
x: "x",
y: "y",
fill: "orange",
r: 5,
tip: true
}),
Plot.linearRegressionY(data, {
fx: (d) => niceFx(d.class),
fy: (d) => niceFy(d.class),
x: "x",
y: "y",
stroke: "blue",
fill: "orange",
r: 5,
tip: true,
ci: 0
})
]
});