Public
Edited
May 12, 2023
3 forks
4 stars
Insert cell
Insert cell
Plot.plot({
color: { type: "diverging" },
aspectRatio: 1,
marks: [
Plot.contour({
fill: peaks,
stroke: "currentColor",
x1: -3,
x2: 3,
y1: -2.2,
y2: 2.2
})
]
})
Insert cell
// adapted from https://www.mathworks.com/help/matlab/ref/peaks.html
peaks = (y, x) =>
3 * (1 - x) ** 2 * Math.exp(-x * x - (y + 1) ** 2) -
10 * (x / 5 - x ** 3 - y ** 5) * Math.exp(-x * x - y * y) -
(1 / 3) * Math.exp(-y * y - (x + 1) ** 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