Welcome to Citizendium - the Citizens' Compendium! See something needing your input? Click here to Join us in providing quality, expert-guided information to the public for free! Wednesday, November 14: November 2012 Monthly Donor Day. - Donate here - Monthly Donor Honor Roll

# Contour plot

Main Article
Talk
Related Articles  [?]
Bibliography  [?]
Code [?]

This is a draft article, under development and not meant to be cited; you can help to improve it. These unapproved articles are subject to a disclaimer.
Fig.1. Function $f(x,y)= \sin\left(\frac{\pi}{4}x\right) \sin\left(\frac{\pi}{4}y\right)$ is plotted in the range $-10\le x\le 10~$, $-10\le y\le 10~$. Levels $f(x,y)=-0.1$ are shown with red lines. Levels $f(x,y)= 0.1$ are shown with blue lines.

Contour plot is kind of graphical image that shows some function $f(x,y)$ with lines

(1) $f(x,y)=L$,


where $L$ is constant, called level. Such lines are called isolines. If many isolines are shown, their density indicate the slop of the function.

One example of the contour plot is shown in Figure 1. Function $f(x,y)= \sin\left(\frac{\pi}{4}x\right) \sin\left(\frac{\pi}{4}y\right)$ is plotted in the range $-10\le x\le 10~$, $-10\le y\le 10~$. Levels $f(x,y)=-0.1$ are shown with red lines. Levels $f(x,y)= 0.1$ are shown with blue lines.

An isoline actually is graphic of solution of equation (1). One of variables (for example, $x$) can be considered as independent variable, then, another variable can be treated as solution. Graphic of one isoline is called implicit plot. Contour plot can be considered as set of implicit plots, corresponding some sequence of levels.

Countour plots are used to map some surface: relief of the Earth surface at a geographic map, real and imaginary part of a function of complex variable - any bidimensional distribution.

## Implementation of contour plot in high level languages

Fig.2. Contour plot of function $f=|z-\ln(z)|$ in the complex $z$-plane, made with Mathematica.

Programming languages of high level (Matlab, Mathematica, Maple) offer the special procedures (operators, "functions") for contour plot and implicit plot. These procedures allow quick programming of contour plots of simple functions (see, for ex., Fig.2 and its source), but may be slow in execution and sometimes do not provide a good compromise between quality of the image and size of the file. Customised codes (see examples below) may be more efficient, but require some effort for programming.

## Use of Contour plot

The conrout plot can be used to represent a function of complex variable. The two sequences of implicit plots, for example, for the real and for the imaginaty parts of the function can be plotted versus real and imaginary parts of the argument. For a holomorphic function, the contour lines for the real part are orthogonal to those for the imaginaty part, forming the curvilinear rectangular mesh. The mofulus and phase of a comples function can be used instead of the real and imaginary part. Some deviations from the holomorhism may be revealed with the contour plot.

The following figures were generated using the contour plot:

## External examples

More examples of contour plots and speculations around can be found at Wikipedia http://en.wikipedia.org/wiki/Contour_plot