Plot.plot({
marginLeft: 120,
x: {label: "Vehicles per hour (thousands) →", transform: (x) => x / 1000},
y: {label: null},
marks: [
Plot.ruleX([0]),
Plot.tickX(
traffic,
{x: "vehicles", y: "location", strokeOpacity: 0.3}
),
Plot.tickX(
traffic,
Plot.groupY(
{x: "median"},
{x: "vehicles", y: "location", stroke: "red", strokeWidth: 4, sort: {y: "x"}}
)
)
]
})