Back: plc Forward: pli   FastBack: Graphics Up: Plotting primitives FastForward: Plot limits         Top: Yorick Contents: Table of Contents Index: Concept Index About: About this document

3.1.5 plf

The plf command plots a filled mesh, that is, it gives a solid color to each quadrilateral zone in a two dimensional mesh. The color is taken from a continuous list of colors called a palette. Different colors represent different function values. A palette could be a scale of gray values from black to white, or a spectrum of colors from red to violet.

Unlike plc, for which the z array had the same shape as x and y, the z array in a plf command must be an M-1 by N-1 array if x and y are M by N. That is, there is one z value or color for each zone of the mesh instead of one z value per node:

 
plf, z, y, x
 

A separate palette command determines the sequence of colors which will represent z values. Keywords to plf determine how z will be scaled onto the palette (by default, the minimum z value will get the first color in the palette, and the maximum z the last color), and whether the edges of the zones are drawn in addition to coloring the interior. When the x and y coordinates are projections of a two dimensional surface in three dimensions, the projected mesh may overlap itself, in which case the order plf draws the zones becomes important -- at a given (x,y), you will only see the color of the last-drawn zone containing that point. The drawing order is the same as the storage order of the z array, namely (1,1), (2,1), (3,1), ..., (1,2), (2,2), (3,2), ..., (1,3), (2,3), (3,3), ...

One or two contours plotted in a contrasting color on top of a filled mesh is one of the least puzzling ways to present a function of two variables. The fill colors give a better feel for the smooth variation of the function than many contour lines, but the correspondence between color and function value is completely arbitrary. One or two contour lines solves this visual puzzle nicely, especially if drawn at one or two particularly important levels that satisfy a viewer's natural curiosity.

As of yorick 1.5, z may also be a 3 by M-1 by N-1 array of type char in order to make a true color filled mesh. The first index of z is (red, green, blue), with 0 minimum intensity and 255 maximum.


Back: plc Forward: pli   FastBack: Graphics Up: Plotting primitives FastForward: Plot limits         Top: Yorick Contents: Table of Contents Index: Concept Index About: About this document