Navigation

Operators and Keywords

Function List:

C++ API

: contour3 (z)
: contour3 (z, vn)
: contour3 (x, y, z)
: contour3 (x, y, z, vn)
: contour3 (…, style)
: contour3 (hax, …)
: [c, h] = contour3 (…)

Create a 3-D contour plot.

contour3 plots level curves (contour lines) of the matrix z at a Z level corresponding to each contour. This is in contrast to contour which plots all of the contour lines at the same Z level and produces a 2-D plot.

The level curves are taken from the contour matrix c computed by contourc for the same arguments; see the latter for their interpretation.

The appearance of contour lines can be defined with a line style style in the same manner as plot. Only line style and color are used; Any markers defined by style are ignored.

If the first argument hax is an axes handle, then plot into this axis, rather than the current axes returned by gca.

The optional output c are the contour levels in contourc format.

The optional return value h is a graphics handle to the hggroup comprising the contour lines.

Example:

contour3 (peaks (19));
colormap cool;
hold on;
surf (peaks (19), "facecolor", "none", "edgecolor", "black");

See also: contour, contourc, contourf, clabel, meshc, surfc, caxis, colormap, plot.

Demonstration 1

The following code

 clf;
 colormap (cool (64));
 surf (peaks (19), "facecolor", "none", "edgecolor", [0.85 0.85 0.85]);
 hold on;
 contour3 (peaks (19));
 hold off;
 axis tight;
 zlim auto;
 view (315, 17);
 title ({"contour3 of peaks() function", "gray surf() shows peaks function"});

Produces the following figure

Figure 1

Package: octave