I’m trying to use Observable Plot for a grouped bar chart, but I’m having a hard time with getting cut off values on the groups for the Y axis.
This is my original code:
Plot.plot({
y: {axis: null, type: "band"},
x: {tickFormat: "s", grid: true},
color: {scheme: "cool", legend: true, type: "ordinal"},
marks: [
Plot.barX(complaintsByBorough, {
y: "borough",
x: "count",
fill: "borough",
fy: "complaintCategory",
sort: {y: "y"}
}),
Plot.ruleX([0]),
],
})
And I’m getting this:
I know this has something to do with the y-axis settings, but it seems like certain things are turned on, even with “axis”: null, because when I remove `y: {axis: null, type: “band”}, I get this:
I’d like the axis labels to either be not cut off, and still anchored at the end, or I’d like for the axis labels to be anchored at the start, but only the grouping labels rather than each individual bar.