Public
Edited
Jan 28
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
// color: { legend: true },
marks: [
Plot.dot(data, {
y: "UNION POR LA PATRIA (%)",
x: "LA LIBERTAD AVANZA (%)",
// fill: "Provincia",
fill: "steelblue",
stroke: "white",
tip: true,
title: (d) => d.Provincia,
r: 6
}),
Plot.ruleX([0], { stroke: "grey", strokeWidth: 0.5 }),
Plot.ruleY([0], { stroke: "grey", strokeWidth: 0.5 })
]
})
Insert cell
Plot.plot({
// color: { legend: true },
marks: [
Plot.dot(data, {
x: "LA LIBERTAD AVANZA (%)",
y: "UNION POR LA PATRIA (%)",
fill: "Provincia",
stroke: "white",
tip: true,
r: 6
}),
Plot.linearRegressionY(data, {
x: "LA LIBERTAD AVANZA (%)",
y: "UNION POR LA PATRIA (%)",
stroke: "red"
}),

Plot.ruleX([18], { stroke: "grey", strokeWidth: 0.5 }),
Plot.ruleY([12], { stroke: "grey", strokeWidth: 0.5 })
]
})
Insert cell
Plot.plot({
marginLeft: 250,
marks: [
Plot.barX(data, {
fill: "grey",
x: "LA LIBERTAD AVANZA (%)",
y: "Provincia",
tip: true
}),
Plot.ruleX([0, 10, 20, 30, 40], { stroke: "white" }),
Plot.ruleX([5, 15, 25, 35, 45], { stroke: "white", strokeWidth: 0.2 })
]
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
x.get(keyz)
Insert cell
// z = d3.scaleSequential(x.get(keyz).domain().reverse(), colors)
z = d3.scaleSequential(x.get(keyz).domain(), colors)
Insert cell
Insert cell
first_column = data.columns[0]
Insert cell
label = (d) => d[first_column] // d.Economy
Insert cell
// colors = d3.interpolateBrBG
// colors = d3.interpolateBlues
// colors = d3.interpolateCubehelixDefault
colors = d3.interpolateRdYlGn
Insert cell
Insert cell
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