Plot.plot({
marginLeft: 70,
marginBottom: 50,
color: {
scheme:'Set3',
legend: true,
marginLeft: 70,
swatchWidth: 10,
swatchHeight: 10,
style: {
color: '#6e757a',
stroke: '#6e757a',
strokeWidth: .1,
},
},
x: {
grid: true,
tickSize: 0,
label: 'Casos totales',
labelOffset: 40
},
y: {
grid: true,
tickSize: 0,
label: 'Población'
},
style: {
color: '#6e757a'
},
marks: [
Plot.linearRegressionY(casos_totales, {
x: 'casos',
y: 'poblacion',
fillOpacity: .05,
strokeOpacity: .5
}),
Plot.dot(casos_totales, {
x: 'casos',
y: 'poblacion',
fill: 'departamento',
fillOpacity: .9,
stroke: '#2e3e4a',
r: 5
}),
Plot.text(["Población y\nCasos de Covid-19"], {
frameAnchor: 'bottom-right',
dy: -80,
lineAnchor: 'bottom',
fontSize: 16,
fontWeight: 'bold',
fill: '#2e3e4a',
lineHeight: 1.5
}),
Plot.text(["por departamento"], {
frameAnchor: 'bottom-right',
dy: -65,
lineAnchor: 'top',
fontSize: 10,
fill: '#2e3e4a'
})
]
})