Published
Edited
Aug 13, 2022
Insert cell
# ex0
Insert cell
ex0={
// plot functions of x
const p = plotter();
p.func(x => 0.1 * (x ** 3), { stroke: 'green', width: 3 });
p.func(x => (x ** 2) - 6, { stroke: 'orange', width: 3 });
p.func(x => Math.sqrt(x), { stroke: 'purple', width: 3, defined: x => x >= 0 });
p.func(x => -Math.abs(x) - 2, { stroke: 'gray', width: 3, dash: '8,2' });
p.tex(String.raw`\frac{1}{3}`, 1, -6, { size: 32, stroke: 'blue', baseline: 'middle', interactive: true });
return p.node;
}
Insert cell
import {plotter} from '@kkim/plotter'
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