addTooltips(
Plot.plot({
marginLeft: 120,
x: {
grid: true,
tickFormat: "s"
},
color: {scheme: "spectral", domain: genders, legend: true},
marks: [
Plot.barX(populationByPrefectureGender, {
y: "district",
x: "population",
fill: "gender",
title: "population",
sort: {y: "x", reverse: true}
}),
Plot.ruleX([0])
]
})
)