Traditional Graphics in the IML Procedure


Common Arguments

The PROC IML graphics subroutines typically take a set of required arguments followed by a set of optional arguments. All graphics primitives take window and viewport as optional arguments. Some PROC IML graphics subroutines, like GPOINT or GPIE, accept implicit repetition factors in the argument lists. The GPOINT call places as many markers as there are well-defined $(x,y)$ pairs. The GPIE call draws as many slices as there are well-defined pies. In those cases, some of the attribute matrices can have more than one element, which are used in order. If an attribute list is exhausted before the repetition factor is completed, the last element of the list is used as the attribute for the remaining primitives.

The arguments to the PROC IML graphics subroutines are positional. Thus, to skip over an optional argument from the middle of a list, you must specify a comma to hold its place. For example, the following call omits the third argument from the argument list:

   call gpoint(x,y, ,"red");

The following list details the arguments commonly used in PROC IML graphics subroutines:

color

is a character matrix or literal that names a valid color as specified in the GOPTIONS statement. The default color is the first color specified in the COLORS= list in the GOPTIONS statement. If no such list is given, PROC IML uses the first default color for the graphics device. Note that color can be specified either as a quoted literal, such as "RED," a color number, such as 1, or the name of a matrix that contains a reference to a valid color. A color number n refers to the nth color in the color list.

You can change the default color with the GSET call.

font

is a character matrix or quoted literal that specifies a valid font name. The default font is the hardware font, which can be changed by the GSET call unless a viewport is in effect.

height

is a numeric matrix or literal that specifies the character height. The unit of height is the gunit of the GOPTIONS statement, when specified; otherwise, the unit is a character cell. The default height is 1 gunit, which you can change by using the GSET call.

pattern

is a character matrix or quoted literal that specifies the pattern to fill the interior of a closed curve. You specify a pattern by a coded character string as documented in the V= option in the PATTERN statement (refer to the chapter on the PATTERN statement in SAS/GRAPH: Reference).

The default pattern set by the PROC IML graphics subsystem is "E," that is, empty. The default pattern can be changed by using the GSET call.

segment-name

is a character matrix or quoted literal that specifies a valid SAS name used to identify a graphics segment. The segment-name is associated with the graphics segment opened with a GOPEN call. If you do not specify segment-name, PROC IML generates default names. For example, to create a graphics segment called PLOTA, use the following statement:

   call gopen("plota");

Graphics segments are not allowed to have the same name as an existing segment. If you try to create a second segment named PLOTA (that is, when the replace flag is turned off), then the second segment is named PLOTA1. The replace flag is set by the GOPEN call for the segment that is being created. To open a new segment named PLOTA and replace an existing segment with the same name, use the following statement:

   call gopen("plota",1);

If you do not specify a replace argument to the GOPEN call, the default is set by the GSTART call for all subsequent segments that are created. By default, the GSTART call sets the replace flag to 0, so that new segments do not replace like-named segments.

style

is a numeric matrix or literal that specifies an index that corresponds to the line style documented for the SYMBOL statement in the chapter on the SYMBOL statement in SAS/GRAPH: Reference. The PROC IML graphics subsystem sets the default line style to be 1, a solid line. The default line style can be changed by using the GSET call.

symbol

is a character matrix or quoted literal that specifies either a character string that corresponds to a symbol as defined for the V= option of the SYMBOL statement or specifies the corresponding identifying symbol number. STAR is the default symbol used by the PROC IML graphics subsystem.

The PROC IML graphics subroutines are described in detail in ChapterĀ 25: Language Reference.

For more information, also see SAS/GRAPH: Reference.