Plot.plot({
y: {
grid: true,
tickFormat: "+f",
label: "↑ Surface temperature anomaly (°F)"
},
color: {
scheme: "BuRd",
legend: true
},
marks: [
Plot.dot(gistemp, {x: "Date", y: "Anomaly", stroke: "Anomaly"}),
(index, scales, values, dimensions) => {
const [y_min, y_max] = scales.scales.y.domain;
if (y_min < 0 && y_max >= 0) {
return Plot.ruleY([0], {strokeDasharray: 10, opacity: 0.5});
}
}
]
})