Plot.plot({
marks: [
Plot.dot(maples2003, {
x: (d) => d.stemMass,
y: (d) => d.stemLength,
fill: (d) => d.watershed
}),
Plot.linearRegressionY(maples2003, {
x: (d) => d.stemMass,
y: (d) => d.stemLength,
fill: (d) => d.watershed
}),
Plot.linearRegressionX(maples2003, {
x: (d) => d.stemMass,
y: (d) => d.stemLength,
fill: (d) => d.watershed,
opacity: 0.7,
stroke: d => d.watershed,
strokeDasharray: '1 3',
fill: 'none'
}),
],
color: { legend: true },
x: { label: "stemMass (g)" },
y: { label: "stemLength (mm)" }
})