Run it in your browser
Playground
Run six real TypePlot examples, explore the view and save data charts to PNG.
Preparing the plot…Real TypePlot, running in this browser.
Drag to pan or orbit. Scroll to zoom. Focus the plot for arrow keys, +/− and Home. PNG export is available for data examples.
Sine and cosine sampled at 200 points from 0 to 2π. Both amplitudes range from −1 to 1.
import { subplots, linspace } from "typeplot";
const { fig, axes: [ax] } = subplots();
const x = linspace(0, 2 * Math.PI, 200);
ax.plot(x, x => Math.sin(x * 1), { label: "Sine" });
ax.plot(x, x => Math.cos(x * 1), { label: "Cosine", lineStyle: "--" });
ax.set({ xLabel: "Angle (radians)", yLabel: "Amplitude" });
ax.grid();
ax.legend();
// Call fig.destroy() when the view unmounts.About the example data
Values come from the formulas and fixed arrays in the sample code. They are illustrative data, not measurements or benchmarks. Visitor-provided source is never evaluated.