numberOfPaperschart = Plot.plot({
marginLeft: 150,
x: { grid: true, domain: [0, 500_000], label: "Number of papers" },
marks: [
Plot.barX(
data.filter((d) => d.measure === "Number of papers"),
{
x: "value",
y: "country_english",
fill: (d) => (d["country_english"] === "Japan" ? "#eb5b25" : "#36a9e1"),
sort: { y: "x", reverse: true }
}
),
Plot.ruleX([0])
]
})