Equation Plotter
Plot any single-variable expression in x as an inline SVG with axes and zero crossings.
Overview
The Equation Plotter renders any single-variable expression in x as an inline SVG chart with axes and zero-crossing markers. Type something like sin(x) * x or x^2 - 4 and see the curve appear immediately — no spreadsheets, no extra software, no installs.
It is built for maths students checking the shape of a function, engineers sanity-checking a fitted curve and teachers preparing a quick illustration for a slide. Inline SVG means the result is crisp at any zoom and easy to drop into a document.
How it works
The expression is parsed into an abstract syntax tree, with support for + - * / ^, parentheses and the usual function names sin, cos, tan, exp, ln, log, sqrt, abs. The plotter then samples x across the chosen domain (say, -10 to 10), evaluates f(x) at each step and connects the points with a polyline.
Axes auto-fit the data range with a small margin, and zero crossings are highlighted with dots so roots of the function are easy to spot. The SVG is generated server-side or client-side depending on the build and remains a single self-contained file.
Examples
x^2 - 4 → parabola crossing zero at x = -2 and x = 2
sin(x) → wave with zeros at multiples of π
1 / x → hyperbola with a vertical asymptote at x = 0
exp(-x^2) → Gaussian bell curve centred at 0
FAQ
What variable should I use?
x only. The plotter is single-variable; for 3D plots use a dedicated tool.
Does it handle implicit equations like x2 + y2 = 1?
No — only y = f(x). To plot a circle, parameterise it and plot each variable separately.
How are discontinuities handled?
The plotter detects huge jumps between consecutive samples and breaks the line, so a 1/x plot doesn't show a vertical line through zero.
Can I change the domain?
Yes — the default is around -10 to 10, but you can set custom bounds for both x and y.
Is the SVG zoomable?
Yes — SVG scales to any size without pixelation. Copy the markup into your editor of choice.