Plot.plot({
facet: {
data: occ_ai_parsed,
y: "group",
marginLeft: 250
},
marks: [
Plot.frame({stroke: "#aaa", strokeWidth: 0.5}),
Plot.dot(occ_ai_parsed, {x: `dv_rating${selected_attr[_selected]}`, y: "a_median", r: 3, fill:'steelblue', fillOpacity: 0.8}),
Plot.dot(occ_ai_parsed, {x: `human_rating${selected_attr[_selected]}`, y: "a_median", r: 3, fill:'darkorange', fillOpacity: 0.8}),
Plot.ruleX(
occ_ai_parsed,
Plot.groupZ(
{ x: "median" },
{ x: `dv_rating${selected_attr[_selected]}`, stroke: 'steelblue', strokeDasharray: [3, 2] }
)
),
Plot.ruleX(
occ_ai_parsed,
Plot.groupZ(
{ x: "median" },
{ x: `human_rating${selected_attr[_selected]}`, stroke: 'darkorange', strokeDasharray: [3, 2] }
)
),
],
width: 1000,
height: 2000,
marginTop: 0,
marginLeft: 200,
x: {inset: 10, grid: true, label: "Human rating"},
y: {axis: null, inset: 2, label: "median salary"},
color: {
domain: ["ChatGPT-4", "Human"],
range: ["steelblue", "darkorange"],
legend: true
},
style: {fontSize: "12px"},
})