Unlisted
Edited
Sep 7, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
y: { grid: true },
x: { grid: true, label: "Threshold" },
marks: [
Plot.lineY(data, {
x: "threshold",
y: "fp_cost",
tip: true,
stroke: "red",
strokeWidth: 3
}),
Plot.lineY(data, {
x: "threshold",
y: "fn_cost",
tip: true,
stroke: "darkblue",
strokeWidth: 3
}),
Plot.lineY(data, {
x: "threshold",
y: "total_savings",
tip: true,
stroke: "green",
strokeWidth: 3
}),
Plot.dot(["fp_cost", "fn_cost", "total_savings"], {
x: () => data[i].threshold,
y: (d) => data[i][d],
fill: "black",
r: 5
}),
Plot.ruleY([0], { strokeWidth: 5 })
]
})
Insert cell
data = FileAttachment("df_scores.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.
Learn more