Public
Edited
Sep 15, 2023
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.line(covid_depto, {
x: 'fecha',
y: 'casos'
})
]
})
Insert cell
Insert cell
Plot.plot({
color: {
scheme: 'Reds'
},
marks: [
Plot.ruleX(covid_depto, {
x: 'fecha',
y: 'casos',
stroke: 'decesos',
}),
Plot.line(covid_depto, {
x: 'fecha',
y: 'casos'
})
]
})
Insert cell
Insert cell
Plot.plot({
height: 350,
y: {
grid: true,
tickSize: 0,
label: 'casos diarios'
},
x: {
tickSize: 0,
label: null
},
style: {
color: '#6e757a'
},
color: {
scheme: 'Reds',
legend: true,
tickSize: 0,
style: {
color: '#6e757a'
}
},
marks: [
Plot.ruleX(covid_depto, {
x: 'fecha',
y: 'casos',
stroke: 'decesos',
}),
Plot.line(covid_depto, {
x: 'fecha',
y: 'casos',
stroke: '#2e3e4a',
strokeWidth: .6
}),
Plot.text(["Casos y decesos de covid-19 en"], {
frameAnchor: 'top-right',
lineAnchor: 'bottom',
dy: -10,
fontSize: 10,
fontWeight: 'bold'
}),
Plot.text([departamento], {
frameAnchor: 'top-right',
lineAnchor: 'top',
fontSize: 25,
fontWeight: 'bold'
}),
]
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
marginLeft: 100,
marks:[
Plot.barX(casos_totales, {
y: 'departamento',
x: 'casos'
})
]
})
Insert cell
Insert cell
Plot.plot({
marginLeft: 100,
marks:[
Plot.barX(casos_totales, {
y: 'departamento',
x: 'casos',
sort: {
y: 'x',
reverse: true
}
})
]
})
Insert cell
Insert cell
Plot.plot({
marginLeft: 100,
marginTop: 50,
x: {
tickSize: 0,
grid: true,
label: null
},
y: {
tickSize: 0,
label: null
},
style: {
color: '#6e757a'
},
marks:[
Plot.barX(casos_totales, {
y: 'departamento',
x: 'casos',
fill: '#2e3e4a',
sort: {
y: 'x',
reverse: true
}
}),
Plot.text(['Casos Totales de Covid-19'], {
frameAnchor: 'top-left',
lineAnchor: 'bottom',
dy: -30,
fontSize: 16,
fontWeight: 'bold',
fill: '#2e3e4a'
}),
Plot.text(['por departamento'], {
frameAnchor: 'top-left',
lineAnchor: 'top',
dy: -20,
fontSize: 10,
fill: '#2e3e4a'
})
]
})
Insert cell
Insert cell
Insert cell
Plot.plot({
marginLeft: 70,
color: {
scheme: 'Set3',
legend: true
},
marks: [
Plot.dot(casos_totales, {
x: 'casos',
y: 'poblacion',
fill: 'departamento',
}),
]
})
Insert cell
Insert cell
Plot.legend({color: {
type: 'linear',
scheme: 'Reds'
}})
Insert cell
Insert cell
Plot.legend({color: {
type: 'categorical',
scheme: 'Set3',
domain: [1,2,3,4,5]
}})
Insert cell
Insert cell
Plot.plot({
marginLeft: 70,
color: {
scheme: 'Set3',
legend: true
},
marks: [
Plot.linearRegressionY(casos_totales, {
x: 'casos',
y: 'poblacion'
}),
Plot.dot(casos_totales, {
x: 'casos',
y: 'poblacion',
fill: 'departamento',
}),
]
})
Insert cell
Insert cell
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'
})
]
})
Insert cell
Insert cell
Insert cell
tabla = aq.fromCSV(await FileAttachment("datos.csv").text())
Insert cell
tabla.view()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more