Public
Edited
May 12, 2023
5 forks
1 star
Insert cell
Insert cell
Plot.plot({
height: 300,
marginLeft: 60,
y: { axis: null },
x: { nice: true },
fy: { domain: ["FEMALE", "MALE"] }, // excludes N/A
color: { legend: true },
facet: { data: penguins, y: "sex" },
marks: [
Plot.areaY(
penguins,
Plot.binX(
{ y2: "proportion" }, // using y2 to avoid areaY’s implicit stacking
{
x: "culmen_length_mm",
fill: "species",
fillOpacity: 0.1,
thresholds: 10,
curve: "natural"
}
)
),
Plot.ruleY([0]),
Plot.lineY(
penguins,
Plot.binX(
{ y: "proportion" },
{
x: "culmen_length_mm",
stroke: "species",
thresholds: 10,
curve: "natural"
}
)
)
]
})
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