About the Drawing Space and Drawing Units

Each draw statement positions a drawn element using Cartesian coordinates that you specify as X and Y values in the statement. The coordinates that you specify are positioned relative to the drawing space that is in effect for the statement. The available drawing spaces are the data area, the wall area, the layout area, and the graph area. The coordinates can be specified in pixel units, percentage units, or as values that are in the units of the data (available only in the data area).
The images that accompany the following descriptions all use pixel data units. Each, however, was drawn in a different data space using this same LAYOUT OVERLAY definition block:
layout overlay /
    xaxisopts=(display=(line ticks tickvalues))
    yaxisopts=(display=(line ticks tickvalues));
  scatterplot x=height y=weight;
    drawrectangle x=0 y=0 width=50 height=50 /
      anchor=bottomleft display=(fill) fillattrs=(color=green)
      transparency=0.75 widthunit=pixel heightunit=pixel ;
    drawline x1=0 y1=0 x2=18 y2=18 / lineattrs=(color=red) ;
endlayout;
Drawing Space: Data Area
Drawing Units: VALUE, PERCENT, PIXEL
The area where data is displayed in the graph, honoring the offsets that are set for the axes. For a discussion on axis offsets, see Adjusting Axis Offsets.
The data area does not apply to graphs that do not have axes, such as pie charts, which must be drawn in a REGION layout.
For graphs produced within LAYOUTDATAPANEL and LAYOUTDATALATTICE layouts, drawn elements are clipped if they extend outside of the wall boundaries.
data drawing space
Drawing Space: Wall Area
Drawing Units: PERCENT, PIXEL
The area bounded by orthogonal axis pairs, ignoring the offsets that are set for the axes. In two-dimensional graphs, there is one wall bounded by the XY axes. including the secondary axes, if used. In three-dimensional graphs, there are three walls, bounded by the XY, YZ, and XZ axes.
The wall area does not apply to graphs that do not have axes, such as pie charts, which must be drawn in a REGION layout.
For graphs produced within LAYOUTDATAPANEL and LAYOUTDATALATTICE layouts, drawn elements that extend outside of the wall boundaries are clipped.
wall drawing space
Drawing Space: Layout Area
Drawing Units: PERCENT, PIXEL
The entire area of the layout container that is the immediate parent container of the draw statement. The figure to the right shows the case where a LAYOUT OVERLAY is the draw statement’s layout container.
Titles and footnotes are always displayed outside of the outermost layout, so those areas are never part of the layout drawing space.
layout drawing space
Drawing Space: Graph Area
Drawing Units: PERCENT, PIXEL
The entire area that is available to the graph display, whether a single-cell or multi-cell graph.
Because the graph drawing space spans the entire graph, the location of the drawn element in the graph is independent of the draw statement’s placement within the template definition, even if the draw statement is specified within a nested layout.
graph drawing space
To specify the drawing space for both the X and the Y dimension, you use the DRAWSPACE= option. To specify the drawing space individually for either the X or the Y dimension, you use the options XSPACE=, X1SPACE=, X2SPACE=, YSPACE=, Y1SPACE=, or Y2SPACE=, depending on the draw statement. The value that you set on any of these options is a single composite value that specifies both the drawing space and the drawing units in the following format:
<DrawingSpace><Units>
For example, DRAWSPACE=GRAPHPIXEL specifies the GRAPH drawing space with PIXEL drawing units, indicating that the statement’s X,Y coordinates are expressed in pixels. Similarly, DRAWSPACE=LAYOUTPERCENT specifies the LAYOUT drawing space with PERCENT drawing units, indicating that the statement’s X,Y coordinates are expressed as percentages.
The global DRAWSPACE is LAYOUTPERCENT. The global DRAWSPACE= setting for all of the draw statements is LAYOUTPERCENT. The draw statements inherit the global setting from the DRAWSPACE= setting in the BEGINGRAPH statement.
  • To change the global drawing space and drawing units for all of the draw statements within the template definition, use the DRAWSPACE= option in the BEGINGRAPH statement.
  • To change the default for an individual draw statement, use that statement’s DRAWSPACE= option. If needed, you can specify different settings for the different draw statements within the template definition.
For the DATA drawing space, the VALUE drawing units specify that the coordinates are expressed as values along the axis. When you specify the DATA drawing space, you can use the draw statement’s XAXIS= and YAXIS= options to specify which axis scale to use for the coordinates.
  • If the specified axis does not exist in the plot or is not valid for the draw statement's layout container, the draw statement is ignored.
  • For a discrete axis, if the statement’s specified X or Y value does not exist in the data, the draw statement is ignored.
  • For a continuous axis, if the statement’s specified X or Y value does not exist in the data, the value is extrapolated.
When specifying the drawing space and drawing units, you can set a common setting for all of the X and Y coordinates. Or you can specify different settings for each individual coordinate. The DRAWSPACE= setting in the BEGINGRAPH statement applies the global space and unit settings to all of the draw statements within the BEGINGRAPH/ENDGRAPH block. The DRAWSPACE= setting in an individual draw statement applies the space and unit setting only to the coordinate(s) for that statement. Thus, for lines and arrows, the setting applies to both the X1, Y1 coordinate and the X2, Y2 coordinate.
To specify the drawing space and drawing units separately for the X coordinate and for the Y coordinate, use the XSPACE=, YSPACE=, X1SPACE=, Y1SPACE=, X2SPACE=, and Y2SPACE= options, as applicable, in each draw statement. These options override the DRAWSPACE= option.