Plot.plot({
color: { legend: true },
marks: [
Plot.frame({ strokeOpacity: 0.1 }),
Plot.rectY(
fdata,
Plot.binX(
{ y: "count" },
{
fx: "Gender",
fy: "Treatment",
x: {value: "Grade",
thresholds: [0, 0.32, 0.66, 1.0, 1.32, 1.66, 2.0, 2.32, 2.66, 3, 3.32, 3.66, 4, 4.32, 4.66]},
fill: "Treatment",
tip: true
}
)
),
Plot.ruleY([0])
]
})