GPOLY Call

CALL GPOLY (x, y <*>, style <*>, ocolor <*>, pattern <*>, color <*>, window <*>, viewport ) ;

The GPOLY subroutine is a graphical call that draws and fills a polygon.

The required arguments to the GPOLY subroutine are as follows:

x

is a vector that defines the horizontal coordinates of the corners of the polygon.

y

is a vector that defines the vertical coordinates of the corners of the polygon.

The optional inputs to the GPOLY subroutine are as follows:

style

is a numeric matrix or literal that specifies an index that corresponds to a valid line style.

ocolor

is a matrix or literal that specifies a valid outline color. The ocolor argument can be specified as a quoted text string (such as 'RED'), the name of a character matrix that contains a valid color as an element, or a color number (such as 1) that refers to a color in the color list.

pattern

is a character matrix or quoted literal that specifies the pattern to fill the interior of a closed curve.

color

is a valid SAS color used in filling the polygon. The color argument can be specified as a quoted text string (such as 'RED'), the name of a character matrix that contains a valid color as an element, or a color number (such as 1) that refers to a color in the color list.

window

is a numeric matrix or literal that specifies a window. This is given in world coordinates and has the form

 

{minimum-x minimum-y maximum-x maximum-y}

viewport

is a numeric matrix or literal that specifies a viewport. This is given in normalized coordinates and has the same form as the window argument.

The GPOLY subroutine fills an area enclosed by a polygon. The polygon is defined by the set of points given in the vectors $x$ and $y$. The color argument is the color used in shading the polygon, and ocolor is the outline color. By default, the shading color and the outline color are the same, and the interior pattern is empty. The coordinates in use for this graphics command are world coordinates. An example that uses the GPOLY subroutine follows:

call gstart;
xd = {20 20 80 80};
yd = {35 85 85 35};
call gpoly (xd, yd, , ,"X", 'red');
call gshow;