The PLplot Plotting Library: Programmer's Reference Manual
Prev | Chapter 3. Advanced Use of PLplot | Next

# Setting the Area Fill Pattern

The routine `plpat` can be used to set the area fill pattern. The pattern consists of 1 or 2 sets of parallel lines with specified inclinations and spacings. The arguments to this routine are the number of sets to use (1 or 2) followed by two pointers to integer arrays (of 1 or 2 elements) specifying the inclinations in tenths of a degree and the spacing in micrometers (the inclination should be between -900 and 900). Thus to specify an area fill pattern consisting of horizontal lines spaced 2 mm apart use:

        *inc = 0;
        *del = 2000;
        plpat(1, inc, del);

To set up a symmetrical crosshatch pattern with lines directed 30 degrees above and below the horizontal and spaced 1.5 mm apart use:

        *inc = 300;
        *(inc+1) = -300;
        *del = 1500;
        *(del+1) = 1500;
        plpat(2, inc, del);

The routine `plpsty` can be used to select from 1 of 8 predefined patterns.

The area fill routines also use the current line style, width and colors to give a virtually infinite number of different patterns.

Prev | Home | Next
Setting Line Attributes | Up | Setting Color