Plot.plot({
x: {axis: null, _padding: 0.1, _inset: 6},
y: {tickFormat: "s", grid: true},
fx: {_inset: 90, _round: 10, _align: 0, _padding: 0, label: null, _tickRotate: 90, tickSize: 5},
color: {scheme: "spectral", legend: true},
marks: [
Plot.barY(data, {
x: "key",
y: "population",
fill: "key",
fx: "state",
_padding: 10.5,
sort: {x: null, color: null, fx: {value: "y", reverse: true, reduce: "sum"}}
}),
Plot.ruleY([0])
]
})