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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more