Platform
Resources
Pricing
Sign in
Get started
François Semecurbe Marouchi
I have a PhD in geography and I am a spatial data enthusiast. I encourage map making and fractal analysis to explain the world.
Workspace
Fork
Public
By
François Semecurbe Marouchi
Edited
Sep 4, 2023
Fork of
Make an array of Plots
1
Insert cell
Insert cell
data
=
FileAttachment
(
"penguins.csv"
)
.
csv
(
{
typed
:
true
}
)
Insert cell
Insert cell
attributes
=
[
"culmen_length_mm"
,
"culmen_depth_mm"
,
"flipper_length_mm"
,
"body_mass_g"
]
Insert cell
Insert cell
Plot
.
rectY
(
data
,
Plot
.
binX
(
{
y
:
"count"
}
,
{
x
:
"body_mass_g"
}
)
)
.
plot
(
{
width
:
300
,
height
:
100
}
)
Insert cell
Insert cell
htl
.
html
`${
attributes
.
map
(
(
name
)
=>
Plot
.
rectY
(
data
,
Plot
.
binX
(
{
y
:
"count"
}
,
{
x
:
name
}
)
)
.
plot
(
{
width
:
300
,
height
:
100
}
)
)
}`
Insert cell
Insert cell
htl
.
html
`<div style="
display: grid;
grid-gap: 1.75em;
grid-template-columns: repeat(2, 3fr);
">${
attributes
.
map
(
(
name
)
=>
Plot
.
rectY
(
data
,
Plot
.
binX
(
{
y
:
"count"
}
,
{
x
:
name
}
)
)
.
plot
(
{
width
:
450
,
height
:
250
}
)
)
}</div>`
Insert cell
Insert cell
Insert cell
htl
.
svg
`<svg height=${
attributes
.
length
*
height
}>${
attributes
.
map
(
(
name
,
i
)
=>
htl
.
svg
`<g transform="translate(0, ${
height
*
i
})">
${
Plot
.
rectY
(
data
,
Plot
.
binX
(
{
y
:
"count"
}
,
{
x
:
name
}
)
)
.
plot
(
{
width
:
300
,
height
}
)
}
</g>`
)
}</svg>`
Insert cell
height
=
100
Insert cell
Insert cell
import
{
tweet
}
from
"@mbostock/tweet"
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
data
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
attributes
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
height
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
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