Public
Edited
Apr 24, 2023
2 forks
Insert cell
Insert cell
weights30 = [
0, 0, 0.01, 0.01, 0.02, 0.02, 0.03, 0.05, 0.07, 0.09, 0.11, 0.15, 0.19, 0.23,
0.28, 0.34, 0.4, 0.46, 0.52, 0.59, 0.66, 0.72, 0.78, 0.84, 0.88, 0.92, 0.96,
0.98, 1, 1, 1, 0.98, 0.96, 0.93, 0.9, 0.85, 0.81, 0.76, 0.71, 0.66, 0.61,
0.55, 0.5, 0.45, 0.41, 0.36, 0.32, 0.28, 0.25, 0.22, 0.19, 0.16, 0.14, 0.12,
0.1, 0.09, 0.07, 0.06, 0.05, 0.04, 0.04, 0.03, 0.02, 0.02, 0.02, 0.01, 0.01,
0.01, 0.01, 0.01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
]
Insert cell
weights160 = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.01,
0.01, 0.01, 0.01, 0.01, 0.01, 0.02, 0.02, 0.02, 0.03, 0.03, 0.03, 0.04, 0.05,
0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.12, 0.13, 0.15, 0.16, 0.18, 0.2, 0.22,
0.25, 0.27, 0.3, 0.32, 0.35, 0.38, 0.41, 0.44, 0.47, 0.5, 0.53, 0.57, 0.6,
0.63, 0.67, 0.7, 0.73, 0.76, 0.79, 0.82, 0.85, 0.87, 0.89, 0.92, 0.94, 0.95,
0.97, 0.98, 0.99, 0.99, 1, 1, 1, 0.99, 0.99, 0.98, 0.97, 0.95, 0.94, 0.92,
0.9, 0.88, 0.85, 0.83, 0.8, 0.77, 0.75, 0.72, 0.69, 0.66, 0.63, 0.6, 0.57,
0.54, 0.51, 0.48, 0.45, 0.42, 0.4, 0.37, 0.35, 0.32, 0.3, 0.28, 0.26, 0.24,
0.22, 0.2, 0.18, 0.17, 0.15, 0.14, 0.13, 0.12, 0.1, 0.09, 0.09, 0.08, 0.07,
0.06, 0.06, 0.05, 0.04, 0.04, 0.03, 0.03, 0.03, 0.02, 0.02, 0.02, 0.02, 0.01,
0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0
]
Insert cell
weights160[190]
Insert cell
data = [
...weights30.map((d, i) => ({ value: d, x: i, cat: "30" })),
...weights160.map((d, i) => ({ value: d, x: i, cat: "160" }))
]
Insert cell
Plot.plot({
y: {
grid: true,
axis: false
},
x: {
ticks: 10,
axis: false
},
color: {
legend: true,
scheme: "PuBu"
},
fy: {
domain: ["30", "160"]
},
marks: [Plot.barY(data, { x: "x", y: "value", fy: "cat", fill: "cat" })]
})
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