Plot.plot({
height: 300,
x: { tickFormat: "$d", label: "Current rent", legend: true },
y: { ticks: 0 },
symbol: {
legend: true,
domain: ["Nov. '23 leases", "Leases began Novembers 2014-2022"],
range: ["circle", "square"],
width: 1000
},
marks: [
Plot.dotX(
max202311,
Plot.dodgeY({
anchor: "middle",
x: "currRent",
fill: (d) => (d.month === "2023-11" ? "darkorange" : "lightgrey"),
stroke: (d) => (d.month === "2023-11" ? "black" : "none"),
symbol: (d) => (d.month === "2023-11" ? "circle" : "square"),
r: 3.1
})
),
Plot.ruleX([2013.5], { stroke: "black", inset: 25 }),
Plot.text([[2013.5, 0]], {
text: ["Median: $2013.50"],
textAnchor: "start",
dy: -100,
dx: 5
})
]
})