Plot.plot({
width: 700,
height: 700,
x: {
type: 'log'
},
marks: [
Plot.arrow(pop_dem_1991, {
x1: d => findGDP(d.iso3, 1991),
x2: d => findGDP(d.iso3, 2021),
y1: 'total_fertility_rate',
y2: d => pop_dem_2021.find(e => e.iso3 == d.iso3).total_fertility_rate,
opacity: 0.6,
channels: { region: 'region' },
tip: true
}),
Plot.ruleY([2.1], {stroke: 'red'})
]
})