Plot.plot({
marginRight: 150,
height: 600,
inset: 10,
x: { tickFormat: String, label: "NutriScore (higher is less nutritious) →" },
y: {
type: "log",
ticks: [0.3, 1, 3, 10, 30],
tickFormat: String,
label: "↑ Environmental impact"
},
color: { legend: true },
marks: [
Plot.dot(data, {
x: "NutriScore_Scaled",
y: "Tot_env_100g_scaled",
fill: "Colour"
}),
Plot.text(data, {
x: "NutriScore_Scaled",
y: "Tot_env_100g_scaled",
fill: "Colour",
text: "Aisle",
dx: 4,
textAnchor: "start"
})
]
})