Public
Edited
Aug 14, 2023
Insert cell
Insert cell
Insert cell
plot = Plot.plot({
inset: 8,
grid: true,
marks: [
Plot.dot(penguins, {
x: "flipper_length_mm",
y: "body_mass_g",
fill: "black",
opacity: 0.6
}),
Plot.line(
[
[170, ff(170)],
[235, ff(235)]
],
{ strokeWidth: 3 }
)
]
})
Insert cell
ff = {
let ff = math.compile(f);
return (x) => ff.evaluate({ x: x });
}
Insert cell
Insert cell
Insert cell
d3
.regressionLinear()
.x((d) => d.flipper_length_mm)
.y((d) => d.body_mass_g)(penguins)
Insert cell
Insert cell
math = require("mathjs")
Insert cell
d3 = require("d3", "d3-regression")
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