Plot.plot({
height: 500,
width,
color: {
type: "diverging",
scheme: "burd",
pivot: normalMaxTemp
},
x: {
label: "deg C →"
},
y: {
label: "↑ Number of Days",
ticks: 10
},
marks: [
Plot.rectY(
allMaxTemps,
Plot.binX({ y: "count" }, { x: "maxTemp", fill: "maxTemp" })
),
Plot.ruleX([36], { strokeWidth: 2 }),
Plot.text(
[
{
text: "Maximum temperature reached over the last two days",
x: 36,
y: 300
},
{
text: "Only 0.5% of days have exceeded this temperature",
x: 36,
y: 200
}
],
{
text: "text",
x: "x",
y: "y",
lineWidth: 10,
textAnchor: "start",
dx: 10
}
),
Plot.ruleY([0], { stroke: slate["400"] })
]
})