{
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]
}
});
}