Plot.plot({
marginLeft: 150,
marginRight: 100,
x: { label: "Population", grid: true, tickFormat: (d) => d.toLocaleString("fr-FR") },
y: { label: "Région de France", tickFormat: (d) => donnees_regions1.find( r => r.CODREG === d ).REG },
marks: [
Plot.barX(donnees_regions1, {
x: "PMUN",
y: "CODREG",
fill: "#ff8c38",
opacity: 0.5,
sort: { y: "-x" },
tip: true
}),
Plot.tickX(donnees_regions1, {x: "PMUN", y: "CODREG"}),
Plot.text(donnees_regions1, {x: "PMUN", y: "CODREG", text: (d) => d.PMUN.toLocaleString("fr-FR"), textAnchor: "start", dx: 3}),
Plot.ruleX([0])
]
})