Adding text marks inverts the axis of the chart. Wonder what’s causes the behavior.
Plot.plot({
grid: false,
legend: false,
marginLeft: 80,
x: {
domain: d3.sort(data, d => -d["Size of holding"]).map(d=>d["Size of holding"])
},
marks: [
Plot.barY(data, {
x: "Size of holding",
y: "No of households",
title: "No of households",
text: "No of households",
fill: "hsl(348, 100%, 70%)"
}),
Plot.text(data, {
x: "Size of holding",
y: "No of households",
text: "No of households"
}),
]
})
Complete notebook: Size of land owned by single households in Thailand / Arky / Observable