Login
📚 Online Statistics Education
Chapters ▾
⇩ Download ▾

8.2 Contour Plots

Contour plots portray data for three variables in two dimensions. The plot contains a number of contour lines. Each contour line is shown in an X-Y plot and has a constant value on a third variable. Consider the Figure 1 that contains data on the fat, non-sugar carbohydrates, and calories present in a variety of breakfast cereals. Each line shows the carbohydrate and fat levels for cereals with the same number of calories. Note that the number of calories is not determined exactly by the fat and non-sugar carbohydrates since cereals also differ in sugar and protein.

Contour plot of breakfast cereals with Carbohydrates (10 to 50) on the x-axis and Fat (0 to 10) on the y-axis. Labelled contour lines at 75, 100, 125, 150, 175 and 200 calories run from the lower left to the upper right: the 75-calorie line encloses the low-carbohydrate, low-fat corner and successive lines step outward, so calories rise with both fat and carbohydrates. A black outline marks the boundary of the region where data exist, and a second 150 label appears along the lower right edge.
Figure 1. A contour plot showing calories as a function of fat and carbohydrates.

An alternative way to draw the plot is shown in Figure 2. The areas with the same number of calories are shaded.

The same calories-by-fat-and-carbohydrate contour plot with the bands between the lines filled in: deep blue in the low-calorie corner at low carbohydrate and low fat, through paler blue and grey in the middle, to red in the high-calorie region at high carbohydrate and high fat. Each shaded area represents values less than or equal to the label to its right.
Figure 2. A contour plot showing calories as a function of fat and carbohydrates with areas shaded. An area represents values less than or equal to the label to the right of the area.

Contour plots are used in many disciplines. For example, in cartography, contour lines can indicate areas of equal elevation, whereas in meteorological maps, contour lines can show equal temperature or equal barometric pressure.

Application in Geology
Application in Meteorology

Adapted from Online Statistics Education: A Multimedia Course of Study (onlinestatbook.com), Project Leader: David M. Lane, Rice University. Developed with NSF support. The original work is in the public domain; it is cited here at the authors' request. Changes were made: reformatted as an accessible XYZ web edition with native MathML. License: Public-Domain.