Plot.plot({
color: {
type: "categorical",
legend: true,
domain: ["male", "female"],
range: ["#4269d0", "#ff8ab7"]
},
marks: [
Plot.circle(athletes_selected, {
x: "weight",
y: "height",
fill: "sex",
tip: true,
title: (d) =>
[d.name, "weight: " + d.weight, "height: " + d.height].join("\n")
}),
Plot.linearRegressionY(athletes_selected, {
x: "weight",
y: "height",
stroke: "red"
})
]
})