next up previous contents index
Next: plm: Plot a Mesh Up: Output Primitives Previous: plg: Plot a Graph   Contents   Index


plmesh: Set Default Mesh

Calling Sequence
...

plmesh([y, x][, ireg][, triangle= tri_array]) 
plmesh()

Description
Set the default mesh for subsequent plm, plc, plv, plf, and plfc calls. In the second form, plmesh deletes the default mesh (until you do this, or switch to a new default mesh, the default mesh arrays persist and takes up space in memory). The y, x, and ireg arrays should all be the same shape; y and x will be converted to double, and ireg will be converted to int.

If ireg is omitted, it defaults to ireg(0,)= ireg(, 0)= 0, ireg(1:, 1:)= 1; that is, region number 1 is the whole mesh. The triangulation array tri_array is used by plc and plfc; the correspondence between tri_array indices and zone indices is the same as for ireg, and its default value is all zero. The ireg or tri_array arguments may be supplied without y and x to change the region numbering or triangulation for a given set of mesh coordinates. However, a default y and x must already have been defined if you do this. If y is supplied, x must be supplied, and vice-versa.

Example
The following example creates a mesh whose graph we will see later. For convenience, we show the functions span and a3, which are used to build the data.

def span(lb, ub, n): 
if n < 2: raise ValueError, '3rd arg must be at least 2' 
b = lb 
a = (ub -lb)/(n -1.0) 
return map(lambda x, A= a, B= b: A* x + B, range(n)) 
def a3(lb, ub, n): 
return reshape (array(n* span(lb, ub, n), Float), (n, n)) 
fma() 
limits() 
x = a3(-1, 1, 26) 
y = transpose (x) 
z = x+ 1j* y 
z = 5.* z/(5.+ z* z) 
xx = z. real 
yy = z. imaginary 
plmesh(yy, xx)


next up previous contents index
Next: plm: Plot a Mesh Up: Output Primitives Previous: plg: Plot a Graph   Contents   Index
Michiel Jan Laurens de Hoon 2003-04-19