Home Manual Packages Global Index Keywords Quick Reference |
### 3.1.3 plm The plm command plots a quadrilateral mesh. Two dimensional arrays x and y specify the mesh. The x array holds the x coordinates of the nodes of the mesh, the y array the y coordinates. If x and y are M by N arrays, the mesh will consist of `(M-1)*(N-1)` quadrilateral zones. The four nodes `(x(1,1),y(1,1))`, `(x(2,1),y(2,1))`, `(x(1,2),y(1,2))`, and `(x(2,2),y(2,2))` bound the first zone -- nodes `(1,1)`, `(2,1)`, `(1,2)`, and `(2,2)` for short. This corner zone has two edge-sharing neighbors -- one with nodes `(2,1)`, `(3,1)`, `(2,2)`, and `(3,2)`, and the other with nodes `(1,2)`, `(2,2)`, `(1,3)`, and `(2,3)`. Most zones share edges four neighbors, one sharing each edge of the quadrilateral. The plm command:
    plm, y, x
draws all `(M-1)*N+M*(N-1)` edges of the quadrilateral mesh. Optional keywords allow for separate color and linetype adjustments for both families of lines (those with constant first or second index). An optional third argument is an existence map -- not all `(M-1)*(N-1)` zones need actually be drawn. Logically, the existence map is an `(M-1)` by `(N-1)` array of truth values, telling whether a zone exists or not. For historical reasons, plm instead requires an M by N array called ireg, where `ireg(1,)` and `ireg(,1)` (the first row and column) are all 0, the value for zones which do not exist. Furthermore, for zones which do exist, ireg can take any positive value; the value of `ireg(i,j)` is the "region number" (non-existent zones belong to region zero) of the zone bounded by mesh nodes `(i-1,j-1)`, `(i,j-1)`, `(i-1,j)`, and `(i,j)`. The `boundary=` keyword causes plm to draw only the edges which are boundaries of a single region (the `region=` keyword value). As a simple example, here is how you can draw a four by four zone mesh missing its central two by two zones:
    x = span(-2, 2, 5)(,-:1:5);
    y = transpose(x);
    ireg = array(0, dimsof(x));
    ireg(2:5,2:5) = 1;
    ireg(3:4,3:4) = 0;
    plm, y, x, ireg;
The plc and plf commands plot functions on a quadrilateral mesh.