Plot.plot({
inset: 4,
x: { ticks: "month", label: "Date", tickFormat: "%b" },
y: { label: "Temperature (°C)", ticks: 10, grid: true },
color: {
type: "linear",
scheme: "OrRd",
legend: true,
tickFormat: "d"
},
marks: [
Plot.frame({ anchor: "bottom", stroke: "#bbb" }),
Plot.line(data[region], {
x: "yearAgnosticDate",
y: "temp",
z: "year",
filter: (d) =>
d.year !== 2023 &&
d.temp !== null &&
d.year >= yearInterval[0] &&
d.year <= yearInterval[1],
stroke: "year",
strokeWidth: 1
}),
Plot.line(data[region], {
...y2023LineAttrs,
stroke: "white",
strokeWidth: 3
}),
Plot.line(data[region], {
...y2023LineAttrs,
stroke: "black",
strokeWidth: 1.25
})
]
})