Plot.plot({
width: 820,
height: 320,
color: {
scheme: "reds",
nice: true,
tickFormat: (d) => 100 * d,
label: "Proportion of each facet (%)",
legend: true
},
facet: {
data: penguins,
x: "sex",
marginRight: 80
},
marks: [
Plot.frame(),
Plot.dot(
penguins,
Plot.hexbin(
{ title: "proportion-facet", r: "count", fill: "proportion-facet" },
{ x: "culmen_depth_mm", y: "culmen_length_mm", strokeWidth: 1 }
)
)
]
})