Public
Edited
Jan 7
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.dot(olympians, {
x: "weight",
y: "height",
stroke: "sex",
fill: "sex", // Add fill to match stroke for the legend
channels: { name: "name", sport: "sport" },
r: 2, // Adjust the dot radius if needed
tip: true
})
// // Add text labels below each dot
// Plot.text(olympians, {
// x: "weight",
// y: "height",
// text: "name",
// dy: 10, // Adjust the vertical offset to place the text below the dots
// textAnchor: "middle" // Center-align text
// })
],
color: { legend: true }, // Enable the legend for the color channel
marginBottom: 50, // Adjust margins if needed
marginTop: 20
})
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