Public
Edited
Sep 11, 2023
Insert cell
Insert cell
//data = FileAttachment("penguins.csv").csv({typed: true})
Insert cell
//viewof bins = Inputs.range([3, 20], {step: 1, label: "Bins"})
Insert cell
//Plot.plot({
//marks: [
//Plot.ruleY([0]),
//Plot.rectY(data, Plot.binX({y: "sum"}, {x: "flipper_length_mm", thresholds: bins}))
//]
//})
Insert cell
missing_values3.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
missing_values = FileAttachment("missing_values3.csv").csv({typed: true})
Insert cell
tidy = missing_values.columns.slice(3).flatMap((race) => missing_values.map(d => ({state: d.state, year: d.year, missing_values: d[race]})))

Insert cell
Plot.plot({
width: 928,
height: 800, // Increase height to avoid mushy x-axis labels
x: {label: "State", tickRotate: -45, tickFontSize: 10}, // Adjust properties for x-axis labels
y: {label: "Missing Values", tickFormat: "s", tickSpacing: 50},
color: {scheme: "Spectral", legend: true, label: "Year"},
marks: [
Plot.barY(tidy, {
x: "state",
y: "missing_values",
fill: "year"
})
]
})




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