Plot.plot({
marginTop: 25,
marginBottom: 40,
title: "Average monthly surface temperature, Jan 15, 1940 - Feb 15, 2024*",
subtitle: "2-metre temperature (°C)",
caption:
"Source: Copernicus Climate Change Service (2024) – with major processing by Our World in Data. “Monthly average” [dataset]. Copernicus Climate Change Service, “ERA5 monthly averaged data on single levels from 1940 to present 2” [original data]. *Values computed with truncated window are removed.",
x: {
label: null,
nice: true,
ticks: 5
},
y: {
label: null,
grid: true,
nice: true
},
style: { fontSize: "0.8em" },
marks: [
Plot.lineY(
selectedData,
Plot.windowY(
{ k: K, anchor: "middle", strict: true },
{
x: "Day",
y: "Average surface temperature",
sort: "Day",
curve: "natural",
tip: true
}
)
)
]
})