Plot.plot({
marginLeft: 90,
color: { scheme: "Dark2", legend: true },
x: { percent: true },
marks: [
Plot.barX(
congress,
Plot.groupY(
{ x: "count" },
{
fill: "party",
y: "gender",
sort: { y: "x", reverse: true, color: "width" },
offset: "normalize"
}
)
)
]
})