Skip to content
/ 3D surface and contour plot

3D surface and contour lines

Type a function of two variables: the grapher draws the surface in 3D (rotate with the mouse or a finger) and its contour lines, alone or side by side. The LaTeX export (pgfplots) opens directly in the Otoolia LaTeX editor.

Export:

Axes and grid

Window x …   y …
Tick spacing on x on y
Grid Subdivisions

How to do it

  1. Type z = f(x, y), e.g. x^2 − y^2 (saddle), e^(−x^2−y^2) or sin(x)·cos(y).
  2. Set the domain in x and y, and the mesh.
  3. Choose the display: 3D surface, 2D contour lines, or 2D and 3D side by side; contour lines can also be drawn on the 3D surface (or projected on the floor), and the number of levels can be set.
  4. Export as PNG, copy the LaTeX code or open it in the LaTeX editor to compile it.

Tips

  • Close contour lines indicate a steep slope, as on a topographic map.
  • A saddle point shows as two contour lines crossing.
  • The LaTeX document contains the computed values: it compiles with pdfLaTeX, without gnuplot.

Frequently asked questions

What is a contour line?

The set of points (x ; y) where f(x, y) takes a given value k; it is the cross-section of the surface by the horizontal plane z = k, seen from above.

Does the LaTeX code need a special package?

Only pgfplots, included in every distribution and in the Otoolia LaTeX editor.

Is my data uploaded?

No, everything is computed in your browser.