Published
Edited
Mar 13, 2022
1 fork
2 stars
Insert cell
Insert cell
Insert cell
data = FileAttachment("athletes.csv").csv({typed: true})
Insert cell
Insert cell
version = Plot.version
Insert cell
Plot = require("@observablehq/plot@0.3")
Insert cell
Insert cell
dot_options = ({x: "weight", y: "height", stroke: "sex"})
Insert cell
plot_options = ({color: {legend: true}})
Insert cell
dot_plot = Plot.dot(data, dot_options).plot(plot_options)
Insert cell
Insert cell
data_table = Inputs.table(data)
Insert cell
Insert cell
bin_outputs = ({fillOpacity: "count"})
Insert cell
bin_options = ({x: "weight", y: "height", fill: "sex"})
Insert cell
rect_plot = Plot.rect(data, Plot.bin(bin_outputs, bin_options)).plot(plot_options)
Insert cell
Insert cell
binx_outputs = ({y: "count"})
Insert cell
binx_options = ({x: "weight", fill: "sex"})
Insert cell
recty_plot = Plot.rectY(data, Plot.binX(binx_outputs, binx_options)).plot(plot_options)
Insert cell
Insert cell
facet_options = ({data: data, y: "sex" })
Insert cell
facet_plot = Plot.plot({
grid: true,
facet: facet_options,
marks: [
Plot.rectY(data, Plot.binX(binx_outputs, binx_options)),
Plot.ruleY([0])
]
})
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