Function Grapher
Plot one or more explicit functions y = f(x) on labelled axes, with the domain, the sample count and every gap stated. Download PNG or SVG.
What this page draws
Draws y = f(x) for up to eight expressions on one set of axes, with a legend, a ruler on each axis and a line that is cut wherever the function jumps instead of joined across the gap.
How to use it
Type an expression such as sin(x) or x^2 - 3x + 1, one per line. The optional y = prefix is ignored. Set the x domain and the sample count, then press Draw. Leave the y bounds blank to fit the curves automatically.
Worked example: sin(x) on −10 to 10 with 801 samples becomes a sine wave across ten periods, axes at zero and one legend entry.
What the picture states
Domain: x over the domain you type (default −10 to 10).
Sampling: 801 evenly spaced samples per curve by default, up to 20,001.
The caption under the picture repeats both, so the drawing and the facts cannot disagree.
How it works
Each expression is parsed into an expression tree by a hand-written recursive-descent parser, never by eval. The tree is evaluated at evenly spaced x values across the domain you state; the picture is a polyline through those samples.
What it refuses
An unreadable character, an unknown function or a variable this page does not plot is refused by name, with the position of the problem. More than 20,001 samples, more than eight curves, or an empty domain is refused before anything is drawn.
Where it runs
The picture is computed and drawn in this tab: there is no upload, no network request, no plotting library and no model, so nothing you paste leaves your device.
Draws y = f(x) for up to eight expressions on one set of axes, with a legend, a ruler on each axis and a line that is cut wherever the function jumps instead of joined across the gap.
Each expression is parsed into an expression tree by a hand-written recursive-descent parser, never by eval. The tree is evaluated at evenly spaced x values across the domain you state; the picture is a polyline through those samples. The picture is computed and drawn in this tab: there is no upload, no network request, no plotting library and no model, so nothing you paste leaves your device.
Domain: x over the domain you type (default −10 to 10). Sampling: 801 evenly spaced samples per curve by default, up to 20,001.
Worked example: sin(x) on −10 to 10 with 801 samples becomes a sine wave across ten periods, axes at zero and one legend entry.
How to use the function grapher
Type an expression such as sin(x) or x^2 - 3x + 1, one per line. The optional y = prefix is ignored. Set the x domain and the sample count, then press Draw. Leave the y bounds blank to fit the curves automatically.
The picture is computed and drawn in this tab: there is no upload, no network request, no plotting library and no model, so nothing you paste leaves your device.
- Expressions, one per line (y = optional) — one value or one rule per line
- x from — a number
- x to — a number
- Samples per curve — a number from 2 to 20001
- y bottom (blank fits the data) — typed text
- y top (blank fits the data) — typed text
What the picture states
Draws y = f(x) for up to eight expressions on one set of axes, with a legend, a ruler on each axis and a line that is cut wherever the function jumps instead of joined across the gap.
Each expression is parsed into an expression tree by a hand-written recursive-descent parser, never by eval. The tree is evaluated at evenly spaced x values across the domain you state; the picture is a polyline through those samples.
- Domain: x over the domain you type (default −10 to 10).
- Sampling: 801 evenly spaced samples per curve by default, up to 20,001.
- The caption under the picture repeats the domain and the sample count, so the drawing and the facts cannot disagree.
What it refuses, and what it leaves out
An unreadable character, an unknown function or a variable this page does not plot is refused by name, with the position of the problem. More than 20,001 samples, more than eight curves, or an empty domain is refused before anything is drawn.
- Not the right page for: implicit equations such as x^2 + y^2 = 25, which the conic page plots
- Not the right page for: data points you pasted, which the chart pages draw
What to Expect
Best for
- seeing the shape of an explicit function
- comparing two functions on one ruler
- checking a homework answer by eye
Not ideal for
- implicit equations such as x^2 + y^2 = 25, which the conic page plots
- data points you pasted, which the chart pages draw
What this tool keeps
- The exact domain and sample count in the caption
- One colour and one legend entry per curve
- The gap at every discontinuity
What may need cleanup
- Choosing a narrower domain when a feature is too small to see
- Typing the function in the syntax the page lists
Common errors
- ln is natural log and log is base 10
- A bare 2x is accepted as 2 times x
- tan(x) is cut at each asymptote rather than joined
Example use cases
- A calculus sketch of f and f′
- A physics curve over a stated interval
- A quick sanity check of a formula
Sample input
sin(x) on −10 to 10 with 801 samples
Sample output
a sine wave across ten periods, axes at zero and one legend entry
Who this is for
- Students
- Teachers
- Anyone checking a formula by eye
Frequently asked questions
Is my data sent anywhere?
The picture is computed and drawn in this tab: there is no upload, no network request, no plotting library and no model, so nothing you paste leaves your device.
What can I download?
Two files from the same drawing: a PNG captured from the canvas and an SVG built from the same drawing operations. Both are produced in your browser, and neither is uploaded.
Why does the page state the domain and the sample count?
Because a picture is a finite sample of a mathematical object. Saying where it was sampled and how many points were used is the difference between a plot and a guess. x over the domain you type (default −10 to 10). 801 evenly spaced samples per curve by default, up to 20,001.
Why is there a gap in my tan curve?
At each asymptote the samples grow without bound and then reappear on the other side. A line drawn between those two samples would be a false vertical stroke, so the page cuts the curve and counts the cut in the Gaps not joined figure.
Which functions can I type?
sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh, sqrt, cbrt, abs, exp, ln, log, log10, log2, floor, ceil, round, sign, min, max, atan2, pow and logb, plus the constants pi, e and tau.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.