Graph Plotter

Graph Plotter

Plot mathematical functions and equations. Create line, scatter, parametric graphs. Free online graphing calculator and function visualizer

Plotting y = x² is high-school grade. The interesting cases are simultaneous: plotting y = sin(x), y = 0.5·sin(2x), and y = sin(x) + 0.5·sin(2x) on the same axes to show Fourier addition; plotting parametric (x = cos(t), y = sin(t)) to draw a circle; plotting f(x) and its derivative side by side. This grapher handles all of them, plus polar plots, multiple functions, and explicit / implicit relations — with adjustable range, sampling density, and exports to PNG/SVG for slides.

Function types you can plot

  • Explicit y = f(x) — the standard case. y = x², y = sin(x), y = e^x.
  • Parametric (x(t), y(t)) — both coordinates as functions of a parameter. Curves that fail the "vertical line test" (circles, figure-eights, spirals) need this form.
  • Polar r = f(θ) — radius as a function of angle. Roses (r = cos(2θ)), spirals (r = θ), cardioids (r = 1 - sin(θ)).
  • Implicit f(x, y) = 0 — relations that cannot be solved for y alone. The unit circle x² + y² = 1 is implicit; ellipses, hyperbolas, transcendental curves.
  • Vector fields — (u, v) at each (x, y). For ODEs and fluid dynamics intuition. Tool typically renders arrows on a grid.
  • Sequences / discrete — scatter plot of (n, f(n)) for integer n. Fibonacci, recurrence relations, time series.

Working example: comparing function with derivative

Input

Plot f(x) = sin(x) and f'(x) = cos(x) on [-2π, 2π]

Output

Two curves:
  f(x)  = sin(x)   blue
  f'(x) = cos(x)  red

Key observations from the plot:
  - cos(x) is zero where sin(x) has its peaks and troughs (extrema)
  - cos(x) is positive where sin(x) is increasing
  - cos(x) is negative where sin(x) is decreasing
  - Both functions have the same shape, shifted by π/2

Derivative-as-slope intuition becomes visible when seen together that does not
come through from a list of values.

Plotting a function and its derivative together is a classic calculus teaching trick. The geometric relationship (derivative = slope = rate of change) is opaque on a values table and obvious from the plot.

Sampling and the aliasing trap

A grapher samples the function at N points across the x-range, then draws line segments connecting consecutive samples. If the function oscillates faster than the sampling rate, you get aliasing — the rendered curve does not match the true function. Plot y = sin(100x) at default sampling (100 points across [0, 2π]); you will see a slow wiggle that bears no relation to sin(100x).

Cure: more samples. The Nyquist criterion says you need at least 2 samples per period. For y = sin(kx), use at least 4k samples per 2π. Modern graphers adaptively increase sampling in regions of high curvature, but explicit control matters for high-frequency functions.

Asymptotes and singularities

  • Vertical asymptotes — at f(x) = 1/x near x=0, the function goes to ±∞. Default plotters draw a continuous line connecting +∞ and −∞ across the asymptote, which looks like a spike. Better: detect the sign change and break the curve at the asymptote.
  • Holes — f(x) = (x²−1)/(x−1) is x+1 everywhere except at x=1 where it is 0/0 (undefined, removable). Graphers usually draw the line; the hole at x=1 is invisible unless explicitly marked.
  • Discontinuities — step functions, sign(x), piecewise definitions. Default line-drawing falsely connects across the jump; use scatter mode or explicit discontinuity handling.
  • Domain restrictions — sqrt(x) is undefined for x<0; log(x) is undefined for x≤0. The function "stops" at the boundary; do not extrapolate into the undefined region.

When to reach for this tool

  • You are studying calculus or precalculus and want to see what a function "looks like" before computing properties.
  • You are doing physics or engineering homework where the relationship between variables is best understood graphically (projectile trajectories, RC circuit decay, harmonic oscillators).
  • You are writing a slide or document and need a clean function plot without dragging out Mathematica or matplotlib.
  • You are debugging "the formula in my code does not behave right" — plot it against the expected mathematical curve.

What this tool will not do

  • It will not do symbolic computation. For symbolic derivatives, integrals, simplifications, use a CAS (SymPy, Maple, Wolfram Alpha). The plotter computes values numerically.
  • It will not handle 3D surfaces. f(x, y) = ... needs a 3D plotter (Three.js based or Plotly). 2D-only here.
  • It will not export interactive plots. Output is static PNG/SVG. For interactive embedding, use Plotly, Vega, or D3.
  • It will not solve equations. To find where two curves intersect, plot both and read off graphically — for precision use a root-finder.

Frequently asked questions

Why does my plot have weird vertical lines?

You hit a vertical asymptote (a value where the function tends to ±∞), and the plotter connected the high and low values with a line. Either restrict the y-range to exclude the asymptote, or use a plotter that detects sign changes and breaks the curve.

How do I plot a piecewise function?

Most graphers support conditional syntax: `f(x) = x < 0 ? -x : x²`. Or define both pieces as separate functions and plot together. Watch for: discontinuities at the join point should not be connected by a line.

Why does sin(x) look like a triangle wave when zoomed out?

Aliasing. At low sampling density on a wide range, the plot under-samples the oscillation and connects samples with straight lines. Increase sample count or narrow the range.

Can I plot a function and its derivative at the same time?

Yes — most graphers support multiple functions on the same axes with different colors. Plot f(x) and f'(x) side by side; geometric meaning (slope) becomes visible. For a derivative the tool does not compute symbolically, compute the derivative manually first and plot the result.

How do I plot a parametric curve like a cardioid?

Switch the input mode from "y = f(x)" to "x = f(t), y = g(t)". For a cardioid: x(t) = (1 - sin(t)) · cos(t), y(t) = (1 - sin(t)) · sin(t), t in [0, 2π]. Or use polar mode with r(θ) = 1 - sin(θ).

Can I plot inequalities (e.g., y > x²)?

Some plotters support shaded regions for inequalities. Specify the boundary curve and which side is "the region"; the plotter fills accordingly. Useful for visualizing feasible regions in optimization or constraints in linear programming.

Related tools

Last updated · E-Utils editorial team