Public
Edited
Mar 16, 2023
Insert cell
Insert cell
alphabet

Insert cell
olympians
Insert cell
Plot.plot({
marks: [
Plot.barX(olympians, Plot.groupY({x: "count"}, {y: "nationality", sort: {y: "x", reverse: true, limit: 10}})),
Plot.ruleX([0])
]
})
Insert cell
Plot.plot({
marks: [
// Plot.barX(olympians, {x: ()=> 1, y: "nationality", sort: {y: "x", reverse: true, limit: 10}}),
Plot.barX(olympians, Plot.groupY({x: 'count', title: 'count'}, {y: d => d.nationality, // or y: d => 'nationality' its the same
sort: {y: "x",
reverse: true, limit: 20
}})),
Plot.ruleX([0])
]
})
Insert cell
// binning and histograms
Plot.plot({
marks: [
Plot.dot(olympians, Plot.dodgeY({x: 'weight', fill: 'steelblue', r: 1}))],
x: {
lable: 'weight (kg)'
},
width,
height:1200
})
Insert cell
Plot.plot({
color: {
scheme: "ylgnbu"
},
marks: [
Plot.hexagon(olympians, Plot.hexbin({fill: "sum"}, {x: "weight", y: "height"}))
]
})
Insert cell
viewof numBins = Inputs.range([1, 100], {label: 'number of bins', step: 1})
Insert cell
Plot.plot({
marks: [
Plot.rectY(olympians, Plot.binX({y: 'count'}, {x:'weight', fill: 'steelblue', thresholds: numBins})),
Plot.ruleY([0])
]
})
Insert cell
// stacking, better for less categories
Plot.plot({
marks: [
Plot.barY(olympians, Plot.groupX({y: "count"}, {x: "nationality", fill: 'sex', title: 'sport', sort: {x: "y", reverse: true, limit: 10}})),
]
})
Insert cell
import {Plot} from '@mkfreeman/plot-tooltip'
Insert cell
DonutChart(islands, { name: d => d.name, value: d => d.value, innerRadius: 0})
Insert cell
// staking method, deadline for assignment, april 4th, 2-3 hours
Insert cell
// smoothing and window functions
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