If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

## Multivariable calculus

### Course: Multivariable calculus>Unit 1

Lesson 6: Visualizing multivariable functions (articles)

# Contour maps

When drawing in three dimensions is inconvenient, a contour map is a useful alternative for representing functions with a two-dimensional input and a one-dimensional output.

## The process

Contour maps are a way to depict functions with a two-dimensional input and a one-dimensional output. For example, consider this function:
f, left parenthesis, x, comma, y, right parenthesis, equals, x, start superscript, 4, end superscript, minus, x, squared, plus, y, squared.
With graphs, the way to associate the input left parenthesis, x, comma, y, right parenthesis with the output f, left parenthesis, x, comma, y, right parenthesis is to combine both into a triplet left parenthesis, x, comma, y, comma, f, left parenthesis, x, comma, y, right parenthesis, right parenthesis, and plot that triplet as a point in three-dimensional space. The graph itself consists of all possible three-dimensional points of the form left parenthesis, x, comma, y, comma, f, left parenthesis, x, comma, y, right parenthesis, right parenthesis, which collectively form a surface of some kind.
But sometimes rendering a three-dimensional image can be clunky, or difficult to do by hand on the fly. Contour maps give a way to represent the function while only drawing on the two-dimensional input space.
Here's how it's done:
Example function graph.
• Step 2: Slice the graph with a few evenly-spaced level planes, each of which should be parallel to the x, y-plane. You can think of these planes as the spots where z equals some given output, like z, equals, 2.
Graph with level planes slicing it.
• Step 3: Mark the graph where the planes cut into it.
Graph with level sets marked off.
• Step 4: Project these lines onto the x, y-plane, and label the heights they correspond to.
Leveled sets of a graph in isolation.
Example contour map
In other words, you choose a set of output values to represent, and for each one of these output values you draw a line which passes through all the input values left parenthesis, x, comma, y, right parenthesis for which f, left parenthesis, x, comma, y, right parenthesis equals that value. To keep track of which lines correspond to which values, people commonly write down the appropriate number somewhere along each line.
Note: The choice of outputs you want to represent, such as left brace, minus, 2, comma, minus, 1, comma, 0, comma, 1, comma, 2, right brace in this example, should almost always be evenly spaced. This makes it much easier to understand the "shape" of the function just by looking at the contour map.

## Example 1: Paraboloid

Consider the function f, left parenthesis, x, comma, y, right parenthesis, equals, x, squared, plus, y, squared. The shape of its graph is what's known as a "paraboloid", the three-dimensional equivalent of a parabola.
Graph of f, left parenthesis, x, comma, y, right parenthesis, equals, x, squared, plus, y, squared
Here's what its contour map looks like:
Contour map of f, left parenthesis, x, comma, y, right parenthesis, equals, x, squared, plus, y, squared
Notice that the circles are not evenly spaced. This is because the height of the graph increases more quickly as you get farther away from the origin. Therefore, increasing the height by a given amount requires a smaller step away from the origin in the input space.

## Example 2: Waves

How about the function f, left parenthesis, x, comma, y, right parenthesis, equals, cosine, left parenthesis, x, right parenthesis, dot, sine, left parenthesis, y, right parenthesis? Its graph looks super wavy:
Graph of f, left parenthesis, x, comma, y, right parenthesis, equals, cosine, left parenthesis, x, right parenthesis, dot, sine, left parenthesis, y, right parenthesis
And here is its contour map:
One feature worth pointing out here is that peaks and valleys can easily look very similar on a contour map, and can only be distinguished by reading the labels.

## Example 3: Linear function

Next, let's look at f, left parenthesis, x, comma, y, right parenthesis, equals, x, plus, 2, y. Its graph is a slanted plane.
Graph of f, left parenthesis, x, comma, y, right parenthesis, equals, x, plus, 2, y
This corresponds to a contour map with evenly spaced straight lines:
Contour map of f, left parenthesis, x, comma, y, right parenthesis, equals, x, plus, 2, y

## Example 4: Literal map

Contour maps are often used in actual maps to portray altitude in hilly terrains. The image on the right, for example, is a depiction of a certain crater on the moon.
Contour map of a mountain
Contour map of South Ray crater on the moon, from wikipedia
Imagine walking around this crater. Where the contour lines are close together, the slope is rather steep. For instance, you descend from 7700 meters to 7650 meters over a very short distance. At the bottom, where lines are sparse, things are more flat, varying between 7650 meters and 7628 meters over larger distances.

## Iso-stuffs

The lines on a contour map have various names:
• Contour lines.
• Level sets, so named because they represent values of left parenthesis, x, comma, y, right parenthesis where the height of the graph remains unchanged, hence level.
• Isolines, where "iso" is a greek prefix meaning "same".
Depending on what the contour map represents, this iso prefix might come attached to a number of things. Here are two common examples from weather maps.
• An isotherm is a line on a contour map for a function representing temperature.
• An isobar is a line on a contour map representing pressure.

## Gaining intuition from a contour map

You can tell how steep a portion of your graph is by how close the contour lines are to one another. When they are far apart, it takes a lot of lateral distance to increase altitude, but when they are close, altitude increases quickly for small lateral increments.
The level sets associated with heights that approach a peak of the graph will look like smaller and smaller closed loops, each one encompassing the next. Likewise for an inverted peak of the graph. This means you can spot the maximum or minimum of a function using its contour map by looking for sets of closed loops enveloping one another, like distorted concentric circles.

## Want to join the conversation?

• Are visualisations of magnetic fields contour maps?
• No, visualizations of magnetic fields are vector slope diagrams.
• I've heard to contour integrals, what are they?
• Contour integrals are line integrals over the complex plane.
• could you explain more this statement "Likewise for an inverted peak of the graph. This means you can spot the maximum or minimum of a function using its contour map by looking for sets of closed loops enveloping one another, like distorted concentric circles."
• For example, if 𝑧 = 𝑓(𝑥, 𝑦) has a minimum at (𝑥, 𝑦) = (1, 2),
then on the contour map of 𝑓 there will be these loops (varying in size and shape) that encompass the point (1, 2).
• Can we expect exercises to be added to the multivariate calculus unit like the math units preceding it? It would be very helpful!
(1 vote)
• With Example 2: Waves, what about z = sin (y). There is no x value. How would this work?
(1 vote)
• If you only have z and y that is a function with one input and one output. When you graph it in three dimensions, x can be any real number. You can slide the graph of z=sin y along the x-axis and make a wavy sheet.
(1 vote)
• find the approximate r.f of the map?
(1 vote)
• how do you read a contour map? Btw i thought contour map is a science thing but not math cuz we learned about contour interval stuff in science but not math
(1 vote)
• Lottie, try googling your question, and checking out the explanantions e.g. http://sectionhiker.com/how-to-read-a-topographic-map/. A lot of science is mathematical, and contours can represent heights and depths, like on a geographical map, or temperatures or pressure, like on a weather chart, or a lot of other stuff, both in science and in maths. Like carpenters and geographers might both use rulers.
(1 vote)
• In the contour map for the cos(x)sin(y) function, how is the value of 0.7 arrived at?
(1 vote)
• How to graph the contour map of f(x,y)=cos(x)sin(y)
(1 vote)
• Try plugging in cos(x)*sin(y) to the z= at https://www.math.uri.edu/~bkaskosz/flashmo/graph3d/ and play with the max and min x and y ranges (tip: set grid = 22 and click Enter New Grid for a finer grained graph), then rotate the graph to help you visualise it more clearly.
(1 vote)
• are eyes corneal topographic reports represent contour maps?
(1 vote)