Plot.plot({
title: "Net flux, 2000 — 2024",
subtitle:
"Net flux is a measure of the energy gained or lost by the Earth. Incoming sunlight adds energy, heat radiated into space removes energy. The difference is the net flux. Over the past 25 years the Earth has been gradually retaining more energy than it loses.",
width,
x: { axis: null },
fx: { tickFormat: Plot.formatMonth() },
y: { inset: 10 },
marks: [
Plot.frame(),
Plot.gridY(),
Plot.linearRegressionY(data, {
x: "year",
y: "flux",
fx: "month",
fill: null
}),
Plot.dot(data, {
x: "year",
y: "flux",
fx: "month",
fill: "steelblue",
r: 1.5,
tip: { format: { fx: Plot.formatMonth(), x: "" } }
})
]
})