Public
Edited
Aug 2, 2023
Insert cell
Insert cell
Insert cell
Plot.plot({
marginLeft: 90,
color: { legend: true },
marks: [Plot.barX(congress, Plot.groupZ({ x: "count" }, { fill: "gender" }))]
})
Insert cell
Insert cell
Plot.plot({
marginLeft: 90,
marks: [
Plot.barX(
congress,
Plot.groupY(
{ x: "count" },
{ fill: "gender", y: "party", sort: { y: "x", reverse: true } }
)
),
Plot.text(
congress,
Plot.stackX(
Plot.groupY({ x: "count", text: "count" }, { z: "gender", y: "party" })
)
)
]
})
Insert cell
Insert cell
Plot.plot({
marginLeft: 90,
color: { scheme: "Dark2", legend: true },
x: { percent: true },
marks: [
Plot.barX(
congress,
Plot.groupY(
{ x: "count" },
{
fill: "party",
y: "gender",
sort: { y: "x", reverse: true, color: "width" },
offset: "normalize"
}
)
)
]
})
Insert cell
congress = FileAttachment("us-congress-2023.csv").csv({typed: true})
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