Public
Edited
May 15, 2024
Insert cell
Insert cell
{
const data = [
{ x: 0.5, y: 1.2, category: "Control" },
{ x: -0.2, y: -0.8, category: "Control" },
{ x: 1.1, y: 0.2, category: "Tilt" },
{ x: -1.5, y: 2.8, category: "Tilt" }
];

return Plot.plot({
width: 300,
aspectRatio: 1,
title: "Tilt graph",
color: {
legend: true
},
marks: [
Plot.dot(data, {
x: "x",
y: "y",
fill: "category"
}),
Plot.ruleX([0]),
Plot.ruleY([0])
],
x: {
label: "°",
domain: [-3, 3]
},
y: {
label: "°",
domain: [-3, 3]
}
});
}
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