Plot.plot({
x: { grid: true, label: "Poids (kg)" },
y: { grid: true, label: "Effectif d'athlètes" },
marks: [
Plot.rectY(
athletes.filter( athlete => athlete.sex === sexChoice || sexChoice === "all" ),
Plot.binX({ y: "count" }, { x: "weight", thresholds : nbSeuils, fill: sexChoice === "all" ? "sex" : "tomato" , tip: true })
),
Plot.ruleX([0]),
Plot.ruleY([0])
]
})