Public
Edited
Oct 24, 2022
4 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
X = randomLHS(20, 2).reduce(
(arr, [A, B], drawIndex) => [
...arr,
{
variable: "A",
drawIndex,
value: qunif(A, 1, 10)
},
{
variable: "B",
drawIndex,
value: qunif(B, 20, 30)
}
],
[]
)
Insert cell
Plot.plot({
grid: true,
facet: {
data: X,
y: "variable"
},
marks: [
Plot.rectY(
X,
Plot.binX({ y: "count" }, { x: "value", thresholds: "sturges" })
),
Plot.ruleY([0])
]
})
Insert cell
Insert cell
{
const Y = randomLHS(20, 2).reduce(
(arr, [A, B]) => [
...arr,
{
variable: "A",
value: qnorm(A, 1, 10)
},
{
variable: "B",
value: qnorm(B, 20, 30)
}
],
[]
);

return Plot.plot({
grid: true,
facet: {
data: Y,
y: "variable"
},
marks: [
Plot.rectY(
Y,
Plot.binX({ y: "count" }, { x: "value", thresholds: "sturges" })
),
Plot.ruleY([0])
]
});
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
qunif = (
await import(
"https://cdn.jsdelivr.net/npm/@stdlib/esm@0.0.3/stats/base/dists/uniform/quantile.js"
)
).default
Insert cell
qnorm = (
await import(
"https://cdn.jsdelivr.net/npm/@stdlib/esm@0.0.3/stats/base/dists/normal/quantile.js"
)
).default
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.
Learn more