SGPANEL Procedure

PROC SGPANEL Statement

Creates a panel of plots from input data.

Requirement:An input data set is required.

Syntax

PROC SGPANEL <options> ;

Summary of Optional Arguments

ASPECT=positive-number

specifies the aspect ratio of the plot’s wall area.

CYCLEATTRS | NOCYCLEATTRS

specifies whether plots are drawn with unique attributes in the graph.

DATA=input-data-set

specifies the SAS data set that contains the variables to process.

DATTRMAP=discrete-attribute-map-data-set

specifies the discrete attribute map data set that you want to use with the SGSCATTER procedure.

DESCRIPTION="text-string"

specifies a description for the output image.

NOAUTOLEGEND

disables automatic legends from being generated.

NOSUBPIXEL | SUBPIXEL

specifies whether subpixel rendering should be used for rendering line plots and bar charts.

OPAQUE | NOOPAQUE

specifies whether the graph background is opaque or transparent.

PAD=dimension<units> | (pad-options)

specifies the amount of extra space to add to the left, right, top, and bottom of the graph.

PCTLEVEL=BY | CELL | GRAPH | GROUP

specifies the scope of graph data that is calculated in percentages.

PCTNDEC=numeric-value

specifies the number of decimal spaces to be used to calculate the percent values.

RATTRMAP=range-attribute-map-data-set

specifies the range attribute map data set that you want to use with the procedure.

SGANNO=annotation-data-set

specifies the SG annotation data set that you want to use.

Optional Arguments

ASPECT=positive-number

specifies the aspect ratio of the plot’s wall area. The ratio is expressed as a positive decimal fraction representing wall height divided by wall width. For example, 0.75 is a 3/4 aspect ratio, and 1.0 is a square aspect ratio.

Small numbers, such as 0.01, produce a short, wide rectangular area. Larger numbers yield a taller, narrower rectangular area.

DefaultThe wall area is sized to the maximum area that can fill the available space.

CYCLEATTRS | NOCYCLEATTRS

specifies whether plots are drawn with unique attributes in the graph. By default, the SGPANEL procedure automatically assigns unique attributes in many situations, depending on the types of plots that you specify. If the plots do not have unique attributes by default, then the CYCLEATTRS option assigns unique attributes to each plot in the graph. The NOCYCLEATTRS option prevents the procedure from assigning unique attributes.

For example, if you specify the CYCLEATTRS option and you create a graph with a SERIES statement and a SCATTER statement, then the two plots have different colors.

If you specify the NOCYCLEATTRS option, then plots have the same attributes unless you specify appearance options such as the LINEATTRS= option.

SeeAutomatic Differentiation of Visual Attributes

DATA=input-data-set

specifies the SAS data set that contains the variables to process. By default, the procedure uses the most recently created SAS data set.

DATTRMAP=discrete-attribute-map-data-set

specifies the discrete attribute map data set that you want to use with the SGSCATTER procedure. You specify this option only if you are using a discrete attribute map to control visual attributes of the graph.

RestrictionThe procedures do not support an attribute map that is stored in a table. Only standard SAS data sets are supported for attribute map data.
RequirementThe values in the DATTRMAP data set must be sorted by ID. If they are not, only the first value is found.
SeeUsing Discrete Attribute Maps
Overview of Attribute Maps

DESCRIPTION="text-string"

specifies a description for the output image. The description identifies the image in the following locations:

  • the alternate text for the image in HTML output
  • the table of contents that is created by the CONTENTS option in an ODS statement

The default description is “The SGPANEL Procedure”.

AliasDES=
NoteThe name of the output image is specified by the IMAGENAME= option in the ODS GRAPHICS statement.
TipYou can disable the alternate text in HTML output by specifying an empty string. That is, DESCRIPTION="".

NOAUTOLEGEND

disables automatic legends from being generated. By default, legends are created automatically for some plots, depending on their content. This option has no effect if you specify a KEYLEGEND statement.

NOSUBPIXEL | SUBPIXEL

specifies whether subpixel rendering should be used for rendering line plots and bar charts. Subpixel rendering produces smoother curves and more precise bar spacing.

DefaultWhen neither option is specified, the system applies SUBPIXEL when it makes sense for the graph.
Subpixel rendering is always enabled for vector-graphics output.
RequirementAntialiasing must be enabled for the SUBPIXEL option to have any effect. Antialiasing is enabled by default. To re-enable antialiasing, use the ANTIALIAS=ON option in the ODS GRAPHICS statement.
InteractionIf the SUBPIXEL option is explicitly set in the ODS GRAPHICS statement, that setting is used.
TipFor a large amount of data, antialiasing is disabled when the number of observations exceeds the default maximum of 4000 observations. In that case, subpixel rendering is also disabled. To increase the maximum, use the ANTIALIASMAX= option in the ODS GRAPHICS statement.
SeeSubpixel Rendering
ODS GRAPHICS Statement for information about the ANTIALIAS= and ANTIALIASMAX= options.

OPAQUE | NOOPAQUE

specifies whether the graph background is opaque or transparent.

DefaultOPAQUE
RestrictionThe following output formats support transparent background (NOOPAQUE): EMF, PDF, PNG, PS, and SVG, with the following exception. The PS format does not support transparent background when your output format is not vector graphics (that is, your output renders as an image due to some graph feature or you used an OUTPUTFMT= override to an image format, including PNG).
InteractionWhen NOOPAQUE is specified, the background color is not used.

PAD=dimension<units> | (pad-options)

specifies the amount of extra space to add to the left, right, top, and bottom of the graph. The extra space can help make the spacing more aesthetic, or provide blank space for custom annotations.

You specify this option only if you are using the SG annotation feature to annotate your graph. For more information, see Annotating ODS Graphics.

This option creates margins around the graph for company logos, annotated notes, and so on. You can also specify the unit of measurement. The default unit is pixels. For a list of measurement units that are supported, see Units of Measurement.

Use pad options to create non-uniform padding. Edges that are not assigned padding are padded with the default amount.

pad-options can be one or more of the following:

LEFT= numeric-value<units>

specifies the amount of extra space to add to the left edge.

RIGHT= numeric-value<units>

specifies the amount of extra space to add to the right edge.

TOP= numeric-value<units>

specifies the amount of extra space to add to the top edge.

BOTTOM= numeric-value<units>

specifies the amount of extra space to add to the bottom edge.

PCTLEVEL=BY | CELL | GRAPH | GROUP

specifies the scope of graph data that is calculated in percentages. When you calculate percentages using the STAT=PERCENT option, the calculation can be performed at different levels in the graph. The percentages within the selected level attempt to round up to 100%.

BY

the percentages within each BY-group round up to 100%

InteractionFor this value to take effect, a BY-group must be specified in the procedure.

CELL

the percentages within each panel cell round up to 100%.

GRAPH

the percentages across the entire graph round up to 100%

GROUP

the percentages across groups within a category round up to 100%.

InteractionFor this value to take effect, the GROUP= option must be specified in the plot statement.

In the following examples, the first example specifies a value of GRAPH (the default), and the second example specifies a value of GROUP.

ods graphics on / reset=all;
ods graphics on / width=4.5in;
Graph and Group Values for PCTLEVEL

the bars collectively add up to 100%

PCTLEVEL=GRAPH

proc sgpanel data=sashelp.cars pctlevel=graph;
panelby origin;
where origin in("Asia" "Europe");
vbar type / response=horsepower stat=percent
    group=cylinders;
run;

each bar individually adds up to 100%

PCTLEVEL=GROUP

proc sgpanel data=sashelp.cars pctlevel=group;
panelby origin;
where origin in("Asia" "Europe");
vbar type / response=horsepower stat=percent
    group=cylinders;
run;

In the graph that specifies PCTLEVEL=GRAPH, the bars collectively add up to 100%. Each bar represents a fraction of the total.

In the graph that specifies PCTLEVEL=GROUP, each bar adds up to 100% of the category data represented by the bar. In this case, the categories are age.

DefaultGRAPH
InteractionFor this option to take effect, STAT=PERCENT must be specified for a plot in the procedure.
TipYou can use the PCTNDEC= option in the SGPANEL procedure statement to control the number of decimals to be used when calculating the percent values. The default value is 1.

PCTNDEC=numeric-value

specifies the number of decimal spaces to be used to calculate the percent values.

DefaultThe default number of decimals is based on the magnitude of the largest percentage value.
10% to 100% = 1.1% to < 1% = 3
1% to < 10% = 2< .1% = 4
InteractionFor this option to take effect, STAT=PERCENT must be specified for a plot in the procedure.
TipYou can use the PCTLEVEL= option in the PROC SGPANEL statement to control the scope of the percent calculations.

RATTRMAP=range-attribute-map-data-set

specifies the range attribute map data set that you want to use with the procedure. You specify this option only if you are using a range attribute map to control visual attributes of the graph.

RestrictionThe procedures do not support an attribute map that is stored in a table. Only SAS data sets are supported for attribute map data.
RequirementThe values in the RATTRMAP data set must be sorted by ID. If they are not, only the first value is found.
SeeUsing Range Attribute Maps
Overview of Attribute Maps

SGANNO=annotation-data-set

specifies the SG annotation data set that you want to use. You specify this option only if you are using the SG annotation feature to annotate your graph. For more information, see Annotating ODS Graphics.

Note: The procedures do not support annotation data that is stored in a table. Only standard SAS data sets are supported for annotation data.
Last updated: August 18, 2026