Published
Edited
May 27, 2022
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
// x: { domain: [0, 180]}, // does not work because bar charts aren't quantitative
marks: [
Plot.barY(bins, {x: "theta", y: "count"})
]
});
Insert cell
Insert cell
Plot.plot({
x: {
label: "theta",
domain: [0, 180],
ticks: bins.map(d => d.theta).concat([180]),
},
marks: [
Plot.rectY(bins, {x1: d => d.theta, x2: d => d.theta + 15, y: "count", insetLeft: 2, insetRight: 2})
]
});
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