1.12 Color maps

Color maps provide a graphical means of producing two-dimensional representations of $$(x,y,z)$ surfaces, or equivalently of producing maps of the values $z(x,y)$ of functions of two variables. Each point in the $(x,y)$ plane is assigned a color which indicates the value $z$ associated with that point. In this section, we refer to the third coordinate as $c_1$ rather than $z$, to distinguish it from the third axes of three-dimensional plots$1.

In the following simple example, a color map of the complex argument of the Riemann zeta function $$ζ(z)$ is produced, taking the $(x,y)$ plane to be an Argand plane, with $x$ being the real axis, and $y$ being the imaginary axis. Each point in the plane has an associated value of $c_1$. 

\vspace{2mm} \input{examples/tex/ex_ zeta_ arg_1.tex} \vspace{2mm} 

\centerline{\includegraphics[width=8cm]{examples/eps/ex_ zeta_ arg}} 

The {\tt set c1range} command\index{set c1range command@{\tt set c1range} command} sets the range of values of 

$c_1$ to be assigned colors between black and white. By default, the lowest and highest values of $c_1$ found in the color map is assigned to black and white. 

The {\tt set c1format} command\index{set c1format command@{\tt set c1format} command} controls the format of the axis labels placed along the color scale bar on the right-hand side of the plot. In this case, they are marked as multiples of 

$π$. 

The {\tt set samples grid} command\index{set samples grid command@{\tt set samples grid} command} sets the dimensions of the grid of samples – or pixels – used to render the color map. If either value is replaced with an asterisk ({\tt *}) then the current number of samples set in the {\tt set samples} command is substituted. 

If a data file\  is supplied to the {\tt colormap} plot style, then the datapoints need not lie on the specified regular grid, but are first re-sampled onto this grid using the interpolation method specified using the {\tt set samples interpolate} command\index{set samples interpolate command@{\tt set samples interpolate} command} (see Section~ \ref{sec:spline_ command}). Three methods are available. {\tt nearest\- Neigh\- bor} uses the value of 

$c_1$ associated with the datapoint closest to each grid point, producing color maps which look like Voronoi diagrams. {\tt inverse\- Square} interpolation returns a weighted average of the supplied data points, using the inverse squares of their distances from each grid point as weights. {\tt monag\- han\- Lattan\- zio} interpolation uses the weighting function of Monaghan \&  Lattanzio (1985) which is described further in Section~ \ref{sec:spline_ command}). 

In the following example, a color map of a quadrupole is produced using four input datapoints: 

\vspace{2mm} \input{examples/tex/ex_ quadrupole_1.tex} \vspace{2mm} 

\centerline{\includegraphics[width=8cm]{examples/eps/ex_ quadrupole}} 

$

Footnotes

  1. When color maps are plotted on three-dimensional graphs, they appear in a flat plane on one of the back faces of the plot selected using the axes modifier to the plot command, and the $$c_1$-axis associated with each are entirely independent of the plot’s $z$-axis.$