GPIE Call

CALL GPIE( x, y, r <*>, angle1 <*>, angle2 <*>, color <*>, outline <*>, pattern <*>, window <*>, viewport ) ;

The GPIE subroutine is a graphical call that draws pie slices.

The required arguments to the GPIE subroutine are as follows:

x

is a scalar value that contains the horizontal coordinates of the center of the pie slices. This argument can also be a vector, in which case it defines centers for multiple pie slices.

y

is a scalar value that contains the vertical coordinates of the center of the pie slices. This argument can also be a vector, in which case it defines centers for multiple pie slices.

r

is a scalar or vector that contains the radii of the pie slices.

The optional arguments to the GPIE subroutine are as follows:

angle1

is a scalar or vector that contains the start angles. It defaults to 0.

angle2

is a scalar or vector that contains the terminal angles. It defaults to 360.

color

is a valid SAS color, where color 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.

outline

is an index that indicates the side of the slice to draw. The default is 3.

pattern

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

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 GPIE subroutine draws one or more pie slices. The number of pie slices is the maximum dimension of the first five vectors. The angle arguments are specified in degrees. The start angle (angle1) defaults to 0, and the terminal angle (angle2) defaults to 360. The outline argument is an index that indicates the side of the slice to draw; it can have the following values:

< 0

uses absolute value as the line style and draws no line segment from center to arc.

0

draws no line segment from center to arc.

1

draws an arc and line segment from the center to the starting angle point.

2

draws an arc and line segment from the center to the ending angle point.

3

draws all sides of the slice. This is the default.

The color, outline, and pattern arguments can have more than one element. The coordinates in use for this graphics command are world coordinates. An example that uses the GPIE subroutine follows:

call gstart;
center = {50 50};
r = 30;
angle1 = {0 90 180 270};
angle2 = {90 180 270 360};
/* draw a pie with 4 slices of equal size */
call gpie(center[1], center[2], r, angle1, angle2);