Platform
Resources
Pricing
Sign in
Contact us
Anjana Vakil
Engineer & Educator | Observable Ambassador | Karaoke Enthusiast
Workspace
Fork
Published unlisted
By
Anjana Vakil
Edited
Dec 14, 2021
Fork of
Plot: Histogram
1
Insert cell
Insert cell
import
{
addTooltips
}
from
"@mkfreeman/plot-tooltip"
Insert cell
histogram
=
addTooltips
(
// imported from @mkfreeman/plot-tooltip above
Plot
.
rectY
(
data
,
Plot
.
binX
(
{
y
:
"count"
,
title
:
(
elems
)
=>
`${
elems
.
length
} rows`
}
,
{
x
:
"body_mass_g"
,
thresholds
:
20
}
)
)
.
plot
(
)
,
// Set styles for the hovered element
{
fill
:
"red"
}
)
Insert cell
data
=
FileAttachment
(
"penguins.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.
Try it for free
Learn more
Compare fork
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
histogram
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
data
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML