Nodus Draw: Graphs

Tools › Insert Graph… draws the graph of a function as a smooth curve, which you place in the drawing with a click.

Making a graph

  1. Choose what to plot, and Next:

    • y = f(x), a function of x (or of t);
    • x = f(t) and y = g(t), a curve given by both, such as cos(3t) and sin(2t);
    • r = f(θ), a polar curve, such as 1 + cos(θ) (type θ or theta), its distance from the pole at each angle.

    • Data, columns of numbers: see below.

    For a parametric or polar graph, leave the range empty for a full turn (0 to 2π, or 0 to 360 in degrees).

  2. Type the function after y =, such as sin(x)^2 + sin(x - pi/4), and the range of x: x from 0 to 8*pi. Optionally, y from and to limit the y drawn: tan(x) between -6 and 6 stops at those lines and starts again after each jump. Steps, as in sin(x) > 0.5 (a square wave) or floor(x), are joined by upright lines.

  3. Choose the size: either the whole graph's width and height, or millimetres for one unit of x and of y. With Grid squares in round numbers (and a width and height), the graph is made a little smaller if needed so that a grid square is a round step (π/2, 0.25, 20…).
  4. The preview shows the graph on the drawing's grid, its numbers in the font they will have. The line under it says what a grid square is in the graph's units and how big the graph is (and why, if it is smaller than you asked), or what is wrong with what you typed.
  5. Create: the graph follows the pointer, held by its (0, 0) (a polar graph by its pole); click to place it. Escape leaves it out.

Show axes adds the axes: lines along x = 0 and y = 0, a grid square past the graph where it doesn't reach (or along its edge where 0 is outside its range). Numbers on the axes numbers them every so many grid squares, x every and y every each its own (leave one empty for as many as fit), with π where the range of x is in π (π/4, π/2…) and powers of ten for very large or small values (1.5×10⁶). The numbers are in the drawing's text font and colour (no bigger than fits the grid), and can be formatted afterwards like any text.

The graph is a group (named "Graph of y = …") holding its line, in the drawing's default outline, and its axes and numbers if chosen. Its line is a smooth curve, within a hundredth of a millimetre of the function at any size, which the shape tool can edit.

Editing a graph

Select the graph and choose Tools › Edit Graph… (or right-click it). The wizard opens with the graph's function, range and settings, its size as you gave it: its width and height, or millimetres for one unit. Change what you like and click OK: the graph is drawn again where it is, at the same size and angle.

Its lines are drawn afresh (changes made to their curves with the shape tool are lost), but keep their colours and outlines; the axes keep their style; and the numbers keep their font, size and colour (the x numbers take those of the first x number, the y numbers of the first y number). Anything else you put into the graph's group stays.

Several functions on one graph

Select the graph and choose Tools › Add to Graph… (or right-click it). Choose what to plot and type it as before; the new line is drawn on the graph's axes at its scale (the graph grows if it reaches further), and Add puts it in, in the same colour as the graph's last line, ready to recolour.

Edit Graph… on such a graph has a Line list above the function: choose which line to change, or Remove this line. OK applies all the changes together.

Graphs of data

Choose Data and Next, then paste a table into the box (a CSV file's text, or columns copied from a spreadsheet), or drop a file on it: a row a line, its columns separated by commas, semicolons, tabs or spaces, with headings in the first row if you like. Where the columns are separated by semicolons, tabs or spaces, a comma in a number is a decimal point (1,5).

The line under the box says what was found. x is the column headed x or t, else the first; every other column is a y, each drawn as its own line (untick the ones you don't want). With two columns, Swap x and y swaps them. Next goes on to the y limits and the size, as for a function. Each line goes through its rows' points in order, and stops where a value is missing.

Writing functions

Type For
+ - * / ^ add, subtract, multiply, divide, power (x^2, 2^-x)
2x, 2pi, 3(x+1), x sin(x) multiplication can be left out
pi or π, e, tau the constants
sin cos tan asin acos atan atan2(y, x) trigonometry
sinh cosh tanh hyperbolic functions
exp ln log log10 log2 sqrt cbrt exponentials, logarithms (log and log10 are base 10, ln base e), roots
abs floor ceil round sign min max mod(a, b) others (sign, also sgn, is 1, 0 or −1)
< > <= >= comparisons: 1 if true, 0 if not (sin(x) > 0.5 is a square wave)
deg2rad rad2deg angles

With Angles in degrees, sin(30) is a half, and asin(0.5) is 30. A function of x can use x or t, but not both; x = f(t) and y = g(t) use t, and r = f(θ) uses θ (or theta). With Angles in degrees, a polar graph's θ is in degrees too.

Next: Timing diagrams


This website is free and ad-free, but costs me money to run. If you'd like to support this site, please consider making a small donation or sending me a message to let me know what you liked or found useful.