plot_by_year_ckd = Plot.plot({
marks: [
Plot.barY(ckd_by_year_cumulative, {x: "year", y: "count_tests", fill: "nth_test"}),
Plot.ruleY([0])
],
x: {
type: "band",
labelOffset: 40,
label: "Year"
},
y: {
grid: true,
label: "N. people (cumulative)",
domain: [0, 400000]
},
color: {
type: "categorical",
domain: ["1", "2–9", "10–39", "40–99", "100+"],
range: [palettePink.accent, palettePink.softAccent, palettePink.softAccent2, palettePink.softAccent3, palettePink.softAccent4],
legend: "ramp"
},
style: commonStyle,
marginLeft: 130,
marginTop: 30,
marginBottom: 50
})