Public
Edited
Oct 23, 2022
1 fork
Insert cell
Insert cell
rawdata= `class average grade
1 2
2 3
3 2
4 5
5 4
6 4
7 2
8 5
9 3
10 1`

Insert cell
d3=require('d3-dsv')
Insert cell
data=d3.tsvParse(rawdata)
Insert cell
Plot.plot({
marks: [
Plot.ruleY([0]),
Plot.ruleX([0]),
Plot.line(data, {x: "class", y: "average grade"})
],
x: {
domain: [0,10],
grid: true
},
y: {
domain: [0,5],
grid: true
}
})
Insert cell
Insert cell
new_d3=require('d3-random')
Insert cell
viewof variance = Inputs.range([0, 10], {value: 1, step: 0.1, label: "Variance"})
Insert cell
viewof mu = Inputs.range([-50, 50], {value: 0, step: 1, label: "mu"})
Insert cell
x=Array.from({length: 100},new_d3.randomNormal([mu][variance]))
Insert cell
Plot.plot({
marks: [
Plot.rectY(x, Plot.binX({y: "count"})),
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