Overview of Graph Types

At the top of every plot window there are three popup buttons that set the type of the currently selected graph. Firstly the preimage and image spaces (which maps to a non-empty cell in the table below), then the coordinate system and thirdly the visualization/projection mode, which is described below.

To
ℝ²ℝ³
F
r
o
m
Re, Im, Abs, Phase, Image, Riemann-Image, Color, Riemann-Color, Histogram---
-GraphParametricParametric
ℝ² -Graph, Implicit*Image, Vector Field, ColorParametric
ℝ³ -Implicit*-Vector Field
--ParametricParametric
S¹ × S¹ ---Parametric

*Contour plots can be done by plotting sin(πf) in implicit mode (which draws contours on all integers).

Coordinates

On ℝ² we have cartesian (x and y) and polar coordinates (r and angle φ, which is counterclockwise from the positive real axis). On ℝ³ we have cartesian (x,y,z), spherical (r, φ, θ) and cylindrical coordinates (r, φ, z).

CPlot follows these conventions: In spherical coordinates φ is the counterclockwise angle between the point projected into the XY-plane and the positive real axis, θ is the angle between the Z-axis and the line from 0 to the point in question (when θ = π/2, r and φ are the same as polar in ℝ²).

For cylindrical coordinates: r is the distance from the point to the Z-axis, φ the angle between the point projected into the XY-plane and the positive real axis, and z the z-coordinate of the point. For z=0, this is the same as polar again.

Spherical coordinates

Real-Valued Functions

CPlot draws the two most common real graph types: Line graphs for functions ℝ → ℝ and surface graphs for ℝ² → ℝ. To draw these, select ℝ → ℝ or ℝ² → ℝ from the first dropdown box.

Variable names on ℝ²: x, y, r = √(x²+y²), phi = arg(x+iy).

Variable names on ℝ: x, y = 0, r = |x|, t = x.

For consistency with the other modes there is also u = x, v = y, z = x on ℝ (for switching between real and complex types), z = 0 on ℝ² (for switching between ℝ, ℝ² and ℝ³). All of these automatic variables can be overridden by parameters and zero-ary functions with the same name (for all graph types).

ℝ → ℝ

ℝ² → ℝ

On ℝ² and ℝ³ CPlot can also draw the zero set {x ∈ ℝⁿ | f(x) = 0}, a.k.a. isosurface, level set or implicit function graph.

Variable names on ℝ³ are: x, y, z, r = √(x²+y²+z²), phi, theta (spherical coordinates) and again u = x, v = y.

In the points display mode, this draws points where f(x,y,z) ≤ 0.

x⁴+y⁴+z⁴ - (x²+y²+z²) = -0.42

x⁴+y⁴ - (x²+y²) = -0.28

Complex Functions

The graph of a complex function can either be projected from the 4-dimensional space ℂ² down into ℂ × ℝ, which is what the Real Part, Imaginary Part, Absolute Value and Phase modes do, or we only plot the image, on ℂ, on the Riemann sphere or by color coding.

Variable names: z, x = re(z), y = im(z), r = abs(z), phi = arg(z) and the synonyms u = x, v = y.

Imaginary part of Γ(z)

The image mode, especially when using textures, assigns a color value to every point in the preimage rectangle, maps that rectangle and draw the points at f(z) with the color from z. This shows directly how some area is moved, stretched and folded by the function. The image can be drawn onto the plane representation of ℂ or onto the Riemann sphere (tends to work better when the function has poles).

Image mode for exp(z), using texture

Riemann image of the pole of 1/z²

The color modes assign a color value to every point in the complex plane (now as the image range!) and draw the point at z (now in the preimage range) with the color at f(z). There are four ways of assigning the color:

  1. Tiled mode scales the current texture proportionally so that its width covers [0,1] and tiles the plane with copies of the scaled texture (the corners of four copies meet at 0). This shows how fast the function changes (the smaller the image, the faster f changes), which points get mapped onto the values n + iℝ and ℝ + i n htexture/wtexture (where the seams and corners are), where it does and does not flip the orientation, and conformality is somewhat visible.
  2. Centered mode scales the texture proportionally so that its width covers [-1,1] and the center maps to 0. Points outside the texture will become transparent. This shows all points that get mapped into the textured region, f.e. - if the texture is square and transparent outside a circle, it will show all points that get mapped onto the unit disc.
  3. Riemann mode takes the largest centered disc in the texture, scales it onto the unit disc, maps that onto the Riemann sphere so that 0 becomes the north pole, the entire outside boundary becomes infinity and the circle with radius 1/2 becomes the image of S¹ (π times radius becomes the spherical distance from the north pole). This shows how often f takes every value (number of copies of that texture part) and f(z) is directly visible in the image (assuming the texture is not too uniform). There are two specialized builtin textures for this mode: Phase and Units (in the context menu of the texture control).
  4. Spherical (a.k.a. equirectangular or direct polar) is similar to Riemann but uses the texture's x and y coordinates as spherical coordinates. This maps the entire top border to 0, the bottom border to complex infinity, the left and right borders to [-∞, 0], and the center of the texure to +1.

The difference between the image and color modes is that image mode draws points at f(z) with the color at z, while color mode draws points at z with the color at f(z).

Color mode with tiled texture

The same function with phase texture in Riemann mode

Histograms take some number (controlled by the quality setting) of random points, map them to f(z) and approximate the resulting probability distribution by splitting ℂ into bins (size controlled by the grid setting) and counting how many values get mapped into each bin. The volume of each bar then shows the approximate probability density at that point. In points mode it just plots the mapped points, so the density of the points in some area is related to the volume of the matching histogram bar. Three source distributions are available:

  1. The uniform distribution on the Riemann sphere, which can be useful for figuring out how some function operates on the sphere.
  2. The uniform distribution on a disc around 0 with an arbitrary radius. The center can be shifted by plotting f(z+center).
  3. The complex normal distribution with µ=0 and arbitrary σ.

Riemann-Histogram for z+2

Parametric Functions

These are the images of functions from {ℝ, S¹, ℝ² or S¹ × S¹} to {ℝ² or ℝ³}. Most other plot modes are special cases of these. In the S¹ modes, the variables x and y will have values in [0, 2π], where f(0) and f(2π) will be glued together. In the other modes they can be set to any interval (on the left of the window, under "Axis").

Variable names: x and y a.k.a. u and v. r, phi and z as for graphs. y will be 0 on ℝ and S¹. For functions on ℝ or S¹ there is also t as synonym for x as long as t is not used as a parameter or function name.

Logarithmic spiral

"Spherical Product" from the gallery

Vector Fields

Functions from ℝ² → ℝ² or ℝ³ → ℝ³ can be plotted as vector fields, which have four scaling modes:

  1. Unscaled: Draws the vectors in the axis scale.
  2. Normalized: Scales it so that the largest visible vector has about the same length as the grid width.
  3. Direction Only: Draws all vectors with the same length, again about grid width long.
  4. Connected: Draws connected field lines. It scales the vectors like Normalized does.

Variable names: x, y, z. Also u, v, r ( = √(x²+y²+z²) on ℝ³), phi, theta (on ℝ³) and z = 0 on ℝ² as usual.

 

2D vector field

3D vector field

Phase of Gamma(z) as vector field

Plotting More Than One Function

There are three axis types: 2D, 3D and the Riemann sphere. Combining 2D and 3D yields a 3D plot where the 2D graphs are embedded in the XY-plane, except for ℝ → ℝ graphs, which get embedded in XZ. For different embeddings, parametric modes like ℝ → ℝ³ can be used.

Combining the sphere mode with anything else gives an error ("Axis type mismatch").

Graphs can be added and removed with the +/- buttons of the "Graphs" box in the left hand side of the window. The list entries work like radio buttons in that exactly one of them is always selected (written in bold), which is the current graph whose definition and settings can be modified.

Graphs can be hidden and unhidden with the checkboxes in the graphs list.

sin and cos

Real parts of complex sin and cos