Plot.plot({
style: {
backgroundColor: "white",
fontFamily: "Secular One",
fontSize: 12
},
aspectRatio: 1,
x: {
label: "Age (years) →",
grid: true,
tickSize: 0
},
y: {
grid: true,
label: "← Women · Men →",
labelAnchor: "center",
ticks: false
},
marks: [
Plot.dot(
df,
Plot.stackY2({
x: (d) => 2023 - d.birth_date.getUTCFullYear(),
y: (d) => (d.gender === "male" ? 1 : -1),
fill: (d) =>
d.gender === "male"
? "#4876FF"
: d.gender === "female"
? "#FF3E96"
: "black",
stroke: "black",
r: 10,
title: (d) => `${d.name}: ${d.Age}\n ${d.place_of_death_or_residence}`
})
),
Plot.ruleY([0])
],
height: 800,
width: 1200,
fontfamily: "Secular One"
})