Public
Edited
Jul 6, 2023
1 fork
Insert cell
Insert cell
value = (x, y) =>
(1 + (x + y + 1) ** 2 * (19 - 14 * x + 3 * x ** 2 - 14 * y + 6 * x * y + 3 * y ** 2))
* (30 + (2 * x - 3 * y) ** 2 * (18 - 32 * x + 12 * x * x + 48 * y - 36 * x * y + 27 * y ** 2))
Insert cell
Plot.plot({
width: width + 28,
height: 600,
style: "margin: 0 -14px; width: calc(100% + 28px); max-width: unset;",
color: {scheme: "Magma", type: "log", legend: true, width: 300, label: "Value", tickFormat: ","},
margin: 0,
marks: [
Plot.contour({
x1: -2,
x2: 2,
y1: -2,
y2: 1,
fill: value,
stroke: "#fff",
strokeOpacity: 0.5,
thresholds: d3.range(1, 20).map(n => 2 ** n)
}),
Plot.axisX({anchor: "top", frameAnchor: "bottom", ticks: 20, filter: d => -2 < d && d < 2}),
Plot.axisY({anchor: "right", frameAnchor: "left", filter: d => -2 < d && d < 1})
]
})
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