Public
Edited
May 10, 2023
10 forks
4 stars
Insert cell
Insert cell
Plot.plot({
round: true,
color: {legend: true},
marks: [
Plot.rectY(olympians, Plot.binX({y2: "count"}, {x: "weight", fill: "sex", mixBlendMode: "multiply"})),
Plot.ruleY([0])
]
})
Insert cell
Insert cell
Plot.plot({
color: {legend: true},
marks: [
Plot.rectY(
olympians,
Plot.sort(
{channel: "y2", order: "descending"}, // prevent occlusion 🌶️
Plot.binX(
{y2: "count"}, // opt-out of stacking
{x: "weight", fill: "sex"}
)
)
),
Plot.ruleY([0])
]
})
Insert cell
Insert cell
Plot.plot({
round: true,
color: {legend: true},
marks: [
Plot.rectY(olympians, Plot.binX({y: "count"}, {filter: (d) => d.sex === "male", x: "weight", fill: "sex", insetLeft: 4})),
Plot.rectY(olympians, Plot.binX({y: "count"}, {filter: (d) => d.sex === "female", x: "weight", fill: "sex", insetRight: 4})),
Plot.ruleY([0])
]
})
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