Plot.plot({
x: { inset: 10 },
grid: true,
marks: [
Plot.dot(penguins, {
x: "culmen_length_mm",
y: "culmen_depth_mm",
fill: "species"
}),
Plot.linearRegressionY(penguins, {
x: "culmen_length_mm",
y: "culmen_depth_mm",
strokeDasharray: [1.5, 4],
strokeWidth: 1.5,
stroke: "species",
p: Math.min(Math.max(p, 0), 0.49999)
}),
Plot.linearRegressionY(penguins, {
x: "culmen_length_mm",
y: "culmen_depth_mm",
strokeDasharray: [1.5, 4],
strokeWidth: 1.5,
p: Math.min(Math.max(p, 0.00001), 0.49999)
})
]
})