Skip to content
Graph Craft

Contour / Surface Plot

FacebookX
Example: Risk by price and days to maturity (made-up data)Plotly.js

Variant: Standard

Made-up data, for demonstration only

Variants

4 types · click one to see it in the frame above
Difference from standard
The recommended type; use it as a starting point
Use when
Show how a function's value changes with X and Y

Contour Plot is a chart that draws lines through the points where one variable has the same value, on a plane of two other variables, like height lines on a map. This example shows risk by price ($80–120) and days to maturity (made-up data). Dark colour means high risk.

How to read a Contour Plot

  • The horizontal axis is price and the vertical axis is days to maturity. Every position on the chart has one risk value.
  • Each line is one level of risk. Every point on the same line has the same risk.
  • Lines close together mean steep. Risk changes fast with a small move. Lines far apart mean flat. Risk changes slowly.
  • Nested closed loops are peaks or pits. This example has two risk peaks. The main one is at about a price of $112 and 22 days before maturity. The smaller one is at about $92 and 8 days.
  • Check the colour bar and the numbers on the lines. Dark colour is a high value. The number on a line gives that line's value.
  • Try changing the number of levels. Compare the default view with the "Fine levels" variant to see how the picture changes with how often the lines are drawn.

When to use it

  • You want to see a value that depends on two variables at once, such as risk by price and time, without a hard-to-read 3D chart.
  • You want to find the highest and lowest points and the areas where the value changes fast.
  • The data is a continuous surface, not scattered points.

When not to use it

  • The data is raw points with no continuous value. Use a 2D Density Plot or a Scatter Plot.
  • The two variables are categories. Use a Heatmap.
  • Readers are not used to contour lines. Explain them with a topographic map first.
  • The grid is very coarse. The lines turn angular and get misread.

Common mistakes

1. No numbers on the lines

Readers learn only that a value is high or low, not how much. This example puts numbers on the lines. Try the "No numbers on lines" variant to see how hard it is to read without them.

2. Uneven spacing between levels

If the gap in value between lines is not constant, readers misjudge the slope. State the interval clearly.

3. Too few or too many levels

Too few hide detail and too many make a mess. Try several.

4. Reading a closed line as a real boundary

The lines are estimated from data on a grid. The estimation method affects how far you can trust each line.

5. Using 3D instead of contours

A 3D view makes the back look small and parts hide each other. Contours are easier to read.

Compared with similar charts

ChartHow it differsChoose it when
Contour PlotContour lines of a value on a planeA surface of values from two variables
HeatmapColoured table cellsCategories or a coarse grid
2D Density PlotDensity of raw pointsThe data is points
3D Scatter PlotPoints in three dimensionsThree variables per item

History and development

Contour lines are used in mapmaking to join places of equal height above a reference level, such as mean sea level. Later, names appeared for lines that join points of equal value in many fields. Historical records say Francis Galton proposed the term isogram in 1889.

Frequently asked questions

What are other names for contour lines?

Isoline, isopleth, isoquant and isarithm.

How do I read slope from contour lines?

Lines close together mean steep. Lines far apart mean flat, as on a topographic map.

Can I use it for data that is not height?

Yes, for any value that is a function of two variables, such as risk, temperature or price.

References

  • Contour line · Wikipedia · en.wikipedia.orgUsed to confirm: the definition and basic facts of the contour line
  • The issue with 3D in data visualization · Data to Viz · www.data-to-viz.comUsed to confirm: the problems with 3D charts in data visualization

Last updated 28 Nov 2026