Plot.plot({
inset: 8,
grid: true,
title: "races in the past year",
x: {
label: "distance in meters (not to scale)",
domain: [800, 1600, 5000, 10000, 16000, 42195],
grid: false
},
y: {
grid: true,
percent: true
},
marks: [
Plot.dot(races, { x: "distance", y: "age_grade" }),
Plot.linearRegressionY(races, {
x: "distance",
y: "age_grade",
stroke: "red"
}),
Plot.text(["Race performances within one year of Jul 31 2023"], {
frameAnchor: "top-left",
dy: -20,
dx: 150,
fontWeight: "bold",
fontSize: "12",
textanchor: "start"
})
]
})