next up previous contents index
Next: pl3surf: plot a 3-D Up: The 3D Plotting Functions Previous: The 3D Plotting Functions   Contents   Index


plwf: plot a wire frame

Calling Sequence
...
  
plwf (z [, y, x] [, <keylist>] )

Description
plwf plots a 3D wire frame of the given 2D array z. If x and y are given, then they must be the same shape as z or else len (x) should be the first dimension of z and len (y) the second. If x and y are not given, they default to the first and second indices of z, respectively. plwf calls clear3 before putting the plot command on the display list, which means that PyGist can only show one wire frame at a time using this function. (See pl3tree for graphs with multiple components).

plwf accepts the following keyword arguments:

fill, shade, edges, ecolor, ewidth, cull, scale, cmax A description of the keywords follows: fill: optional colors to use (default is to make zones have background color), same dimension options as for z argument to plf function, i. e., it should be the same dimension as the mesh (vertex-centered values) or one smaller in each dimension (cell-centered values).

shade:
set non-zero to compute shading from the current 3D lighting sources.
edges:
default is 1 (draw edges), but if you provide fill colors, you may set to 0 to suppress the edges.

ecolor, ewidth:
color and width of edges. cull: default is 1 (cull back surfaces), but if you want to see the ``underside'' of the model, set to 0.

scale:
by default, z is scaled to ``reasonable'' maximum and minimum values related to the scale of (x, y). This keyword alters the default scaling factor, in the sense that scale = 2.0 will produce twice the z-relief of the default scale = 1.0.

cmax:
the ambient keyword in light3 can be used to control how dark the darkest surface is; use this to control how light the lightest surface is. The lightwf routine can change this parameter interactively.

Examples

The following example computes the information for a surface with a peak and a valley, and then plots the resulting wire frame with various options. In the first case, we see simply an opaque wire frame.

  
set_draw3_(0) 
x = span (-1, 1, 64, 64) 
y = transpose (x) 
z = (x + y) * exp (-6.*( x* x+ y* y)) 
orient3 ( ) 
light3 ( ) 
plwf (z, y, x) 
[xmin, xmax, ymin, ymax] = draw3( 1) 
limits (xmin, xmax, ymin, ymax) 
plt(" opaque wire mesh", .30, .42)

Next, we see the same surface shaded from a default light source (roughly over the viewer's right shoulder) and with the mesh lined in red.

  
plwf( z, y, x, shade= 1, ecolor=" red") 
[xmin, xmax, ymin, ymax] = draw3( 1) 
limits (xmin, xmax, ymin, ymax)

Finally, the following sequence plots the same surface with no edges, and with lighting coming from the back.

  
plwf( z, y, x, shade= 1, edges= 0) 
light3 ( diffuse=. 1, specular= 1., sdir= array([ 0,0,-1])) 
[xmin, xmax, ymin, ymax] = draw3( 1) 
limits (xmin, xmax, ymin, ymax)


next up previous contents index
Next: pl3surf: plot a 3-D Up: The 3D Plotting Functions Previous: The 3D Plotting Functions   Contents   Index
Michiel Jan Laurens de Hoon 2003-04-19