Plot.plot({
color: {
domain: keys,
scheme: "PuOr",
legend: true
},
y: {
tickFormat: "s",
grid: true
},
x: {
axis: null,
domain: keys
},
fx: { domain: ["FL", "CA", "TX", "IL", "PA"] },
marks: [
Plot.barY(data, {
x: "key",
x2: "key",
y: "population",
fill: "key",
fx: "state"
}),
Plot.ruleY([0])
]
})