Public
Edited
Mar 26, 2024
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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 }, // This computes rolling average. "strict" removes truncated window vals
{
x: "Day",
y: "Average surface temperature",
sort: "Day",
curve: "natural",
tip: true
}
)
)
]
})
Insert cell
selectedData = data.filter((d) => d.Entity == selectedEntity)
Insert cell
entities = [...new Set(data.map((d) => d.Entity))]
Insert cell
data = FileAttachment("average-monthly-surface-temperature@1.csv") // https://ourworldindata.org/temperature-anomaly
.csv({
typed: true
})
.then((data) => {
data.forEach((d) => {
d.Day = parseDate(d.Day);
});
return data;
})
Insert cell
parseDate = d3.timeParse("%d/%m/%Y")
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more