Unlisted
Edited
Dec 6, 2023
Insert cell
Insert cell
color = Plot.scale({color: {scheme: "Tableau10", domain: ["apple", "orange", "pear"]}})
Insert cell
color.apply("apple")
Insert cell
Plot.plot({
color,
marks: [
Plot.barY(data, {x: "fruit", y: "value", fill: "fruit"})
]
})
Insert cell
data = [
{fruit: "apple", value: 1},
{fruit: "orange", value: 3},
{fruit: "pear", value: 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