scatterplot = Plot.plot({
title: md`Darker points are closer to chosen time period <span style="color:#f28e2c">*t = *${obsnumber}</span>.`,
color: {
domain: [0,0.01/Math.log(n)],
scheme: "blues",
label: "Closeness in time to selected time period",
legend: false,
},
marks:
[
Plot.ruleX([0]),
Plot.ruleY([d3.min(simulatedDataLocal.map(d => d.y))]),
Plot.line(
[
{x: 0, y: simulatedDataLocal[obsnumber-1].alpha + 0*simulatedDataLocal[obsnumber-1].beta},
{x: 2, y: simulatedDataLocal[obsnumber-1].alpha + 2*simulatedDataLocal[obsnumber-1].beta}
],
{x: "x", y: "y", stroke: "orange", strokeWidth: 2}
),
Plot.dot(simulatedDataLocal,
{x: "x", y: "y", fill: "weight", strokeWidth: 2}),
Plot.dot(simulatedDataLocal,
{x: "x", y: "y", stroke: "gray", strokeWidth: 0.3, r: 3}),
Plot.tip(simulatedDataLocal, Plot.pointer({
x: "x",
y: "y",
title: (d) => ["time = ", d.time].join("")
}))
]
})