Contour lines can be plotted on a surface, or filled contours can be drawn, or both, by means of the two functions plzcont (plot z contours, i. e., contours according to height in the z direction) and pl4cont (plot 4D contours, i. e., contours determined by some other function defined on the surface.
plzcont (nverts, xyzverts, contours = 8, scale = "lin", clear = 1, edges = 0, color = None, cmin = None, cmax = None, zaxis_min = None, zaxis_max = 0, split = 0) pl4cont (nverts, xyzverts, values, contours = 8, scale = "lin", clear = 1, edges = 0, color = None, cmin = None, cmax = None, caxis_min = None, caxis_max = 0, split = 0)
the i th entry of which gives the number of vertices of the i th polygonal cell; xyzverts are the vertices of the coordinates of the cells, with each consecutive nv [i] entries representing the vertices
of the i-th cell; and values (for pl4cont) being a set of values, one for each vertex. These arguments
are the same format as returned by slice3 and slice3mesh ( see Section ``slice3:
Plane and Isosurface Slices of a 3D mesh'' on page
). plzcont and pl4cont actually do
repeated calls to slice2x (see Section ``slice2 and slice2x: Slicing Surfaces with planes'' on page
) in order to obtain the contour curves.
"lin", "log", or "normal" specifying the contour scale. (Only applicable
if contours = N, of course).
clear == 1, clear the display list first. Otherwise the current contour plot
will be added to the display list.
edges == 1, plot the edges.
color == None, then bytscl the palette into N + 1 colors and send each
of the slices to pl3tree with the appropriate color. If color=="bg", will
plot only the edges. See also split (below).
cmin is given, use it instead of the minimum c actually being plotted in the
computation of contour levels. If cmax is given, use it instead of the maximum
c actually being plotted in the computation of contour levels. This is done so
that a component of a larger graph will have the same colors at the same levels
as every other component, rather than its levels being based on its own maximum
and minimum, which may lie inside or outside those of the rest of the
graph.
zaxis_min and zaxis_max represent axis limits on z as expressed by the
user. If present, zaxis_min will inhibit plotting of all lesser z values, and
zaxis_max will inhibit the plotting of all greater z values.
caxis_min and caxis_max represent axis limits on c as expressed by the
user. If present, caxis_min will inhibit plotting of all lesser c values, and
caxis_max will inhibit the plotting of all greater c values.
"normal" scale. In "normal" scale, the top and bottom contours are two standard
deviations away from the mean. Thus the peak of the sombrero is all the same color because its few
points contribute very little to the standard deviation.
# compute sombrero function
x = arange (-20, 21, typecode = Float)
y = arange (-20, 21, typecode = Float)
z = zeros ( (41, 41), Float)
r = sqrt (add. outer ( x ** 2, y ** 2)) + 1e-6
z = sin (r) / r
fma ()
clear3 ()
gnomon (0)
# Make sure we don't draw till ready
set_draw3_(0)
palette (" rainbow. gp")
[nv, xyzv, dum] = slice3mesh (x, y, z)
plzcont (nv, xyzv, contours = 20, scale = "normal")
[xmin, xmax, ymin, ymax] = draw3 (1)
limits (xmin, xmax, ymin, ymax)
To draw the same function in "lin" scale, with edges visible, enter the following code:
plzcont (nv, xyzv, contours = 20, scale = "lin", edges= 1) [xmin, xmax, ymin, ymax] = draw3 (1) limits (xmin, xmax, ymin, ymax)