chart0 = Plot.plot({
height: 350,
width:700,
marginLeft: 50,
marginRight: 50,
grid: true,
x: {nice: true},
y: {inset: 0},
color: {type: "categorical", legend: true},
facet: {data: data, y: "Route", marginRight: 90},
marks: [
Plot.frame(),
Plot.line(data, {
x: "CO2InKGramsPerPassenger",
y: "Mode",
sort: {
y: {value: "x", reduce: "mean", reverse: true},
fy: {value: "x", reduce: "mean", reverse: true}
}
})
]
})