gdp_co2_plot = Plot.plot({
title: "Annual GDP & C02 Emissions by Country",
caption: "Data Source: World Bank",
y: {grid: true, type: "log"},
x: {grid: true, type: "log"},
color: {legend: true},
marks: [
Plot.dot(world_bank_data, {
x: "gdp",
y: "co2",
fill: "region",
filter: d => (d.year === 2019),
tip: true
}),
Plot.linearRegressionX(world_bank_data, {
x: "gdp",
y: "co2",
filter: d => (d.year === 2019)
})
]
})