Plot.plot({
height: 400,
marginTop: 0,
marginLeft: 50,
x: {inset: 10, grid: true, label: "weight (kg) →"},
y: {axis: null, inset: 2},
color: {legend: true},
fy: {
transform: (d) => d ? Math.floor(d * 10) / 10 : "",
tickFormat: (d) => d ? d.toFixed(1) : "N/A",
label: "height (m) →",
reverse: true
},
facet: {
data: olympians,
y: "height",
marginLeft: 50
},
marks: [
Plot.frame({stroke: "#aaa", strokeWidth: 0.5}),
Plot.boxX(olympians, {x: "weight", y: "sex", stroke: "sex", r: 1})
]
})