Leandro Junes

Plotter

Explore mathematical functions through interactive graphs.

Functions

    Examples

    Graph settings

    Graph

    Move over a curve to read a point; click to pin it.

      Drag to move the view; scroll or pinch to zoom. With the graph focused: arrow keys move the view, plus and minus zoom, 0 resets. In trace mode the left and right arrows move the traced point.

      Tools

      The tools look at the part of the x-axis that is in view.

      Export

      Help

      The plotter draws real-valued functions of one real variable, and breaks a curve wherever the function does.

      Entering a function
      • Type the right-hand side of y = f(x): x^2 - 2, sin(2*x), 1/x, sqrt(4 - x^2), exp(-x^2). The graph follows as you type, and the line under the box shows how the expression was read.
      • Use + - * /, ^ for powers and parentheses. The multiplication sign may be left out where the meaning is plain: 2x, 3(x+1), x sin(x). It has the precedence of * and /, so 1/2x is (1/2)x.
      • Functions need parentheses: sqrt, abs (or |x|), exp, ln (natural logarithm), log (base 10), sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, floor, ceil, sign. Angles are in radians. The constants are pi and e.
      • Scientific notation takes a capital E (1.5E-3), because a small e is always the constant.
      • A mistake in one function is explained under its box and leaves the other curves alone. Nothing typed is ever run as code.
      Several functions

      Add function gives a new row, up to eight. Each row has a colour (click it to change), an eye to hide or show the curve, a line style, and a cross to remove it. Clicking a row selects its function for tracing and for the tools.

      Zooming, moving and axis limits
      • Drag the graph to move it. Scroll, or pinch on a touch screen, to zoom; the point under the pointer stays where it is. The buttons at the edge zoom about the centre, put the first view back, and fit the height to the curves in view.
      • With the graph focused, the arrow keys move the view, + and − zoom and 0 resets.
      • Under Graph settings the four limits can be typed exactly; they may be written with pi, as in -2*pi. Equal axis scales makes one unit as long on the screen in both directions, so that circles look round and slopes are true.
      Reading and tracing a curve

      Move the pointer near a curve to read a point on it; click to pin the point. The coordinates shown are computed from the function at that x, not read off the pixels.

      Trace keeps a marker on the selected function. It follows the pointer, and with the graph focused ← and → move it one pixel at a time (ten with Shift). Where the function has no value the marker says so, and the arrow keys carry it over the gap to the next point that has one.

      Domains, gaps and asymptotes

      A curve is drawn only where the function has a real value. √x starts at 0, ln x exists only for x > 0, and arcsin x only between −1 and 1.

      Where a function jumps or runs off to infinity, as 1/x does at 0 and tan x at odd multiples of π/2, the branches are drawn separately and never joined. A point that is missing from an otherwise unbroken curve is shown as a small open circle:

      (x² − 1)/(x − 1) is the line x + 1 with the point at x = 1 removed, because the expression divides by zero there.

      At a jump, a filled dot marks the value the function takes and an open circle the one it does not, as for floor(x).

      A power with an exponent that is not a whole number is taken to be defined only for a base that is not negative, so x^(1/3) is drawn for x ≥ 0.

      Parameters and sliders

      Any single letter other than x and e is a parameter: in a*sin(b*x) + c the letters a, b, c each get a slider, and the graph follows as they move. A value can also be typed, and the range and step of a slider can be changed. A parameter with the same name in two functions is the same number in both. Up to four are allowed.

      A parameter must stand alone: write a*x or a x, not ax. Two letters side by side are read as a name, and an unknown name is refused, so a slip like sn(x) is reported instead of quietly becoming two sliders.

      The tools: intercepts, extrema, intersections
      • x-intercepts are the zeros of the selected function on the part of the x-axis in view. A zero is verified when the function is shown to be continuous around it and changes sign, or is exactly 0 there. Where the graph only touches the axis, as (x − 1)² does, the zero is reported as a candidate: arithmetic with sixteen digits cannot tell touching from a near miss.
      • The result also says whether the list is complete: it is when the rest of the interval was shown, piece by piece, to contain no zero. When that cannot be shown, the tool says that others may exist.
      • Extrema are found by comparing values at 4001 points and refining, with no derivative, so the corner of |x| is found like any other minimum. They are numerical, good to about eight digits, and a feature narrower than the spacing of the points can be missed.
      • Intersections of two functions are the zeros of their difference, where both are defined.
      How far a graph can be trusted

      A graph is made of finitely many computed points. Before two neighbouring points are joined, the plotter checks, with interval arithmetic on the expression itself, that the function is defined and continuous everywhere between them; where it cannot show that, it closes in on the trouble and breaks the curve there. Where a curve bends or oscillates, more points are computed, until the line is within a quarter of a pixel of the function.

      This is a numerical picture, not a symbolic proof. An expression that oscillates faster than the screen can show, such as sin(1/x) near 0, is drawn as far as a fixed budget of computations allows; and the Equation Solver, not the plotter, is the place for exact solutions.

      Exporting and keeping your work

      Download PNG saves the graph as it is shown, with its axes and grid, on a dark or a light background and at up to three times the screen resolution. The functions, their colours, the parameters and the view are kept in this browser and come back on the next visit; Reset workspace clears them.