Published
Edited
Jan 25, 2022
1 star
Insert cell
Insert cell
Insert cell
Plot.plot({
y: {
grid: true
},
marks: [
Plot.barY(alphabet, { x: "letter", y: "frequency", fill: fill }),
Plot.ruleY([0])
]
})
Insert cell
Insert cell
chart = hatchPlot({
color: {
range: [
"red",
textures.lines().orientation("3/8").size(7).strokeWidth(0.25)
]
},

y: {
grid: true
},
marks: [
Plot.barY(alphabet, {
x: "letter",
y: "frequency",
fill: "isVowel"
}),
Plot.ruleY([0])
]
})
Insert cell
Insert cell
Insert cell
Insert cell
function fill_hatch(d, i) {
return ["A", "E", "I", "O", "U"].includes(d.letter)
? textures.circles().size(4)
: textures.lines().orientation("3/8").size(7).strokeWidth(0.25);
}
Insert cell
Insert cell
Insert cell
Insert cell
alphabet.forEach(
(item) => (item.isVowel = ["A", "E", "I", "O", "U"].includes(item.letter))
)
Insert cell
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