Domain coloring

Domain coloring plot of the function
ƒ(x) =(x2 − 1)(x − 2 − i)2/(x2 + 2 + 2i). The hue represents the function argument, while the saturation and value represent the multiply-wrapped magnitude.

Domain coloring is a technique for visualizing functions of a complex variable. The term "domain coloring" was coined by Frank Farris possibly around 1998.[1][2] There were many earlier uses of color to visualize complex functions, typically mapping argument (phase) to hue.[3] The technique of using continuous color to map points from domain to codomain or image plane was used in 1999 by George Abdo and Paul Godfrey[4] and colored grids were used in graphics by Doug Arnold that he dates to 1997.[5]

Motivation

Insufficient dimensions

A real function $f:\mathbb{R}\rightarrow{}\mathbb{R}$ (for example $f(x)=x^{2}$) can be graphed using two Cartesian coordinates on a plane.

A graph of a complex function $g:\mathbb{C}\rightarrow{}\mathbb{C}$ of one complex variable lives in a space with two complex dimensions. Since the complex plane itself is two-dimensional, a graph of a complex function is an object in four real dimensions. That makes complex functions difficult to visualize in our three-dimensional space. One way of depicting holomorphic functions is with a Riemann surface.

Visual encoding of complex numbers

Given a complex number $z=re^{ i \theta}$, the phase (also known as argument) $\theta$ can be represented by a hue, and the modulus $r=|z|$ is represented by either intensity or variations in intensity. The arrangement of hues is arbitrary, but often it follows the color wheel. Sometimes the phase is represented by a specific gradient rather than hue.

Example

The following image depicts the sine function $w=\sin(z)$ from $-2\pi$ to $2\pi$ on the real axis and $-1.5$ to $1.5$ on the imaginary axis.