Plot.plot({
x: {axis: null, domain: ages},
y: {tickFormat: "s"},
color: {scheme: "spectral", domain: ages},
facet: {data: stateages, x: "state"},
marks: [
Plot.barY(stateages, {
x: "age",
y: "population",
title: "age",
fill: "age",
sort: {fx: "y", reduce: "sum", limit: 6, reverse: true}
}),
Plot.ruleY([0])
]
})