Plot.plot({
x:{
tickFormat: "d"
},
y: {
label: "crash retirements/race"
},
marks: [
Plot.line(hybrid_era_counts, {x: "year", y: "crashRetirementsPerRace", opacity: 0.5}),
Plot.linearRegressionY(hybrid_era_counts, {x: "year", y: "crashRetirementsPerRace", stroke: "halo"}),
Plot.linearRegressionY(hybrid_era_counts, {x: "year", y: "crashRetirementsPerRace", opacity: 0.3}),
Plot.dot(hybrid_era_counts, {x: "year", y: "crashRetirementsPerRace", fill: "halo",
title: (d) =>
`Year: ${d.year} \n ${d.crashRetirementsPerRace.toPrecision(3)} Crash Retirements / Race`})
],
color: {
legend: true,
type: "categorical",
scheme: "tableau10"
}
})