Platform
Resources
Pricing
Sign in
Get started
Harry Stevens
News and graphics at @ClimateLab, a project of @PostGraphics.
Workspace
Fork
Public
2 collections
By
Harry Stevens
Edited
Oct 19, 2022
1 star
Insert cell
Insert cell
stemAndLeafPlot
(
data
)
Insert cell
// Try changing these values!
// They do not need to be in order.
data
=
[
28
,
32
,
41
,
43
,
43
,
43
,
44
,
47
,
47
,
49
,
50
,
51
,
51
,
52
,
53
,
53
,
53
,
54
,
54
,
54
,
54
,
55
,
56
,
56
,
58
,
59
,
69
,
69
,
69
,
73
,
79
,
79
,
83
,
85
,
112
,
118
,
137
]
Insert cell
salp
=
stemAndLeafPlot
Insert cell
// All integers in the interval [0, 99]
salp
(
d3
.
range
(
100
)
)
Insert cell
// A normal distribution of N integers in the interval [0, 99]
salp
(
normal
)
Insert cell
Insert cell
normal
=
{
const
r
=
d3
.
randomNormal
(
)
,
A
=
d3
.
range
(
N
)
.
map
(
r
)
,
s
=
d3
.
scaleLinear
(
)
.
domain
(
d3
.
extent
(
A
)
)
.
rangeRound
(
[
0
,
99
]
)
;
return
A
.
map
(
s
)
;
}
Insert cell
// A random uniform distribution of 100 integers in the interval [0, 99]
salp
(
d3
.
range
(
100
)
.
map
(
n
=>
Math
.
round
(
99
*
d3
.
randomUniform
(
)
(
n
)
)
)
)
Insert cell
Insert cell
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
Fork
View
Export
Listed in...
Components
Harry Stevens
Libraries
Harry Stevens
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
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
salp
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
N
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
normal
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
stemAndLeafPlot
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
processStemAndLeafData
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML