Positioning the Inset Using Coordinates

You can also specify the position of the inset with coordinates: POSITION$=(x,y)$. The coordinates can be given in axis percent units (the default) or in axis data units.

Note: In this release of the PARETO procedure, you cannot position insets by using coordinates when producing ODS Graphics output.

Data Unit Coordinates

If you specify the DATA option immediately following the coordinates, the inset is positioned using axis data units. Data units along the category axis (the horizontal axis on a vertical bar chart or the vertical axis on a horizontal bar chart) are based on category numbers. Categories are numbered from left to right (vertical bar chart) or top to bottom (horizontal bar chart), starting with 1.

See SHWINS2 in the SAS/QC Sample LibraryFor example, the following statements produce the Pareto chart displayed in Figure 15.18:

ods graphics off;
proc pareto data=Failure3;
   vbar Cause / freq = Counts;
   inset n / header   = 'Position=(3,60)'
             position = (3,60) data
             height   = 3;
run;

The bottom left corner of the inset is lined up with the tick mark for the third category on the horizontal axis and at 60 on the vertical axis. By default, the specified coordinates determine the position of the bottom left corner of the inset. You can change this reference point with the REFPOINT= option, as in the next example.

Figure 15.18: Inset Positioned Using Data Unit Coordinates

Inset Positioned Using Data Unit Coordinates


Axis Percent Unit Coordinates

See SHWINS2 in the SAS/QC Sample LibraryIf you do not use the DATA option, the inset is positioned using axis percent units. The coordinates of the bottom left corner of the display are $(0,0)$, while the upper right corner is $(100,100)$. For example, the following statements create a horizontal Pareto chart with two insets, both positioned using coordinates in axis percent units.

ods graphics off;
proc pareto data=Failure3;
   vbar Cause / freq     = Counts
                maxncat  = 5;
   inset n / position = (5,25)
             header   = 'Position=(5,25)'
             height   = 3
             cfill    = blank
             refpoint = tl;
   inset nexcl / position = (95,95)
                 header   = 'Position=(95,95)'
                 height   = 3
                 cfill     = blank
                 refpoint = tr;
run;

The display is shown in Figure 15.19. Notice that the REFPOINT= option is used to determine which corner of the inset is to be placed at the coordinates specified with the POSITION= option. The first inset has REFPOINT=TL, so the top left corner of the inset is positioned 5% of the way across the horizontal axis and 25% of the way up the vertical axis. The second inset has REFPOINT=TR, so the top right corner of the inset is positioned 95% of the way across the horizontal axis and 95% of the way up the vertical axis. Note also that coordinates in axis percent units must be between 0 and 100.

Figure 15.19: Inset Positioned Using Axis Percent Unit Coordinates

Inset Positioned Using Axis Percent Unit Coordinates