GPLOT Procedure

BUBBLE2 Statement

Creates a second vertical axis on the right side of a graph produced by an accompanying BUBBLE or PLOT statement. A second variable can be plotted against this axis.
Requirement: You cannot use the BUBBLE2 statement alone. You can use it only with a BUBBLE or PLOT statement. At least one plot request is required.
Global statements: AXIS, FOOTNOTE, TITLE

Syntax

BUBBLE2 plot-request(s) </option(s)>;

Summary of Optional Arguments

Appearance options
specifies a data set to annotate all graphs that are produced by the GPLOT procedure.
Bubble appearance options
specifies the color for the bubbles.
enables you to generate solid or gradient-filled bubbles.
specifies the font to use for bubble labels.
labels the bubbles with the values of the third variable.
specifies whether the bubble-scaling proportion is based on the area of the circles or the radius measure.
specifies an overall scaling factor for the bubbles so that you can increase or decrease the size of all bubbles by this factor.
ODS options
identifies the variable in the input data set whose values create links or data tips or both.
Plot appearance options
specifies the color for the axis line and all major and minor tick marks.
fills the axis area with the specified color.
specifies the color for all text on the axes, including tick mark values, axis labels, and bubble labels.
plots character of midpoint-type data in data order instead of the default alphabetical order.
specifies whether a line is drawn around the axis area.
specifies that reference lines drawn by the AUTOREF or REF= options should be drawn in front of the bars.
draws reference lines at all major tick marks on both axes.
suppresses the axes, including axis lines, axis labels, all major and minor tick marks, and tick mark values.
Vertical axis options
draws reference lines at all major tick marks on the vertical axis.
specifies the color of reference lines drawn at major tick marks on the vertical axis, as determined by the AUTOVREF option.
specifies the color of reference lines drawn perpendicular to the vertical axis.
specifies a line type for reference lines drawn at major tick marks on the vertical axis, as specified by the AUTOVREF option.
specifies line types for reference lines drawn perpendicular to the vertical axis.
specifies the major tick mark values for the vertical axis or assigns an axis definition.
specifies the number of minor tick marks that are drawn between each major tick mark on the vertical axis.
draws one or more reference lines perpendicular to the vertical axis at specified points.
specifies that the order of the values on the vertical axis should be reversed.
specifies that tick marks on the vertical axis begin in the first position with a zero.
specifies the line width for all reference lines at major tick marks on the vertical axis as determined by the AUTOVREF option.
specifies line widths for reference lines as determined by the vertical axis.

Required Argument

plot-request(s)
each specifies the variables to plot and produces a separate graph. All variables must be in the input data set. Multiple plot requests are separated with blanks. A plot request must have this form:
y-variable*x-variable=bubble-size
plots the values of two variables and draws a circle (bubble) at each data point. The value of the third variable determines the size of the bubble. All of these variables must be in the input data set:
y-variable
variable plotted on the right vertical axis; typically it is different from y-variable in the accompanying BUBBLE or PLOT statement.
x-variable
variable plotted on the horizontal axis; it is the same as x-variable in the accompanying BUBBLE or PLOT statement.
bubble-size
specifies the size of the bubbles. Bubble-size must be numeric. If the value of bubble-size is positive, bubbles are drawn with a solid line. If it is negative, bubbles are drawn with a dashed line.

Optional Arguments

ANNOTATE=Annotate-data-set
specifies a data set to annotate all graphs that are produced by the GPLOT procedure. To annotate individual graphs created using a By statement or multiple action statements, use ANNOTATE= in the action statement.
Alias:ANNO=
AUTOVREF
draws reference lines at all major tick marks on the vertical axis. LAUTOVREF=, CAUTOVREF=, and WAUTOVREF= options can be used to change the line types, colors, and widths of these reference lines. To specify labels for these reference lines, use the VAXIS= option.
BCOLOR=bubble-color
specifies the color for the bubbles. If you do not specify the BCOLOR= option, then the bubble color becomes the color of the default style (GSTYLE) or the color specified by the current ODS style (if used).
Style reference:ContrastColor attribute of the GraphOutline, GraphData1, and TwoColorAltRamp elements
BFILL=SOLID|GRADIENT
enables you to generate solid or gradient-filled bubbles. By default, the JAVA and ActiveX devices create solid bubbles.
  • BFILL=SOLID fills the bubbles with the color specified by the BCOLOR= option. If the BFILL option is not specified, then the color is specified by the current style. If you are using specific ODS style, the color comes from the contrast color attribute within the GraphData1 style element.
  • BFILL=GRADIENT starts with the current axis area color and gradually transitions to the color specified with the BCOLOR= option or the color of the current style. If you are using an ODS style, the colors are controlled by the startcolor and endcolor attributes of the TwoColorAltRamp style element.
Restriction:Not supported by Java and ActiveX
Note:The SAS/GRAPH ActiveX control displays negative values as empty circles.
BFONT=font
specifies the font to use for bubble labels. See Specifying Fonts in SAS/GRAPH Programs for details about how to specify font. If you omit the BFONT= option, a font specification is searched for in this order:
  1. the FTEXT= option in a GOPTIONS statement
  2. the font specified by the current style
  3. the default hardware font
Style reference:Font attribute of the GraphValueText element
Restriction:Not supported by Java and ActiveX
See:the option BLABEL for information about the location and color of labels
BLABEL
labels the bubbles with the values of the third variable. If the variable has a format, the formatted value is used. By default, bubbles are not labeled.
The procedure normally places labels directly outside of the circle at 315 degrees rotation. If a label in this position does not fit in the axis area, other 45-degree placements (that is, 45, 135, and 225 degrees) are attempted. If the label cannot be placed at any of the positions (45, 135, 225, or 315 degrees) without being clipped, the label is omitted. However, labels can collide with other bubbles or previously placed labels.
Labels are displayed in the color specified by the CTEXT= option. If you omit the CTEXT=option, the default is the color of the current style.
BSCALE=AREA | RADIUS
specifies whether the bubble-scaling proportion is based on the area of the circles or the radius measure. By default, BSCALE=AREA.
The value that is assigned to the BSCALE= option affects how large the bubbles appear in relation to each other. For example, suppose the third variable value is twice as big for one bubble as it is for another. If BSCALE=AREA, the area of the larger bubble is twice the area of the smaller bubble. If BSCALE=RADIUS, the radius of the larger bubble is twice the radius of the smaller bubble and the larger bubble has more than twice the area of the smaller bubble.
Restriction:Not supported by Java and ActiveX
BSIZE=multiplier
specifies an overall scaling factor for the bubbles so that you can increase or decrease the size of all bubbles by this factor. By default, BSIZE=5. If you specify BSIZE=0, then the default size is used instead.
In Web output, the Java applets and the ActiveX Control override the default value. To prevent this override, specify a value for the BSIZE= option, rather than relying on the default value.
Restriction:Partially supported by Java and ActiveX
CAUTOVREF=reference-line-color
specifies the color of reference lines drawn at major tick marks on the vertical axis, as determined by the AUTOVREF option. If you do not specify the CAUTOREF option, the default color is the value of the CAXIS= option. If neither option is specified, the default color is retrieved from the current style or from the device's color list if the NOGSTYLE option is specified.
Style reference:Color attribute of the GraphGridLines element
CAXIS=axis-color
specifies the color for the axis line and all major and minor tick marks. By default, the procedure uses the color of the current style.
The CAXIS= option is overridden by the COLOR= option in an AXIS definition. The COLOR= option in an AXIS definition is overridden by the COLOR= suboption of the MAJOR= and MINOR= options in an AXIS definition.
Alias:CA=
Style reference:Color attribute of the GraphAxisLines attribute
CFRAME=background-color
fills the axis area with the specified color. If the FRAME option is also in effect, the procedure determines the color of the frame according to the precedence list given for the FRAME option description. If the IFRAME= option is in effect, the specified image fills the axis area instead of the specified color.
Style reference:Color attribute of the GraphWalls element
CTEXT=text-color
specifies the color for all text on the axes, including tick mark values, axis labels, and bubble labels. The GPLOT procedure searches for a color specification in this order:
  1. colors specified for labels and values on assigned AXIS and LEGEND statements, which override the CTEXT= option specified in the PLOT statement
  2. the color specified by the CTEXT= option in the PLOT statement
  3. the color specified by the CTEXT= option in the GOPTIONS statement
  4. the color specified in the current style, or, if the NOGSTYLE option is specified, then the default color is black for the Java and ActiveX devices and the first color in the color list for all other devices
In an AXIS statement, the COLOR= suboption of either a LABEL= option or a VALUE= option overrides the CTEXT= option and determines the color of the axis label, or the color of the tick mark values, respectively.
Alias:C=
Style reference:Color attributes of the GraphValueText and the GraphLabelText elements
CVREF=reference-line-color | (reference-line-color) | (reference-line-color-list)
specifies the color of reference lines drawn perpendicular to the vertical axis. This option affects reference lines drawn with the AUTOVREF, VREF, and GRID options. Specifying a single color without parentheses applies that color to all reference lines. The CAUTOVREF= option overrides the CVREF= option for lines drawn with the AUTOVREF option. Specifying a single color in parentheses applies that color only to the first reference line drawn with the VREF= option. Specifying a color list applies colors sequentially to successive reference lines drawn with the VREF= option. The syntax of the color list requires parentheses and each color separated by spaces (color1 color2... colorN). If you do not specify the CVREF= option, the GPLOT procedure uses the color specified by the CAXIS= option. If neither option is specified, the default color is retrieved from the current style or from the first color in the color list if the NOGSTYLE option is specified.
Alias:CV=
DATAORDER='entry-description'
plots character of midpoint-type data in data order instead of the default alphabetical order.
Restriction:Supported by Java and ActiveX only
FRAME | NOFRAME
specifies whether a line is drawn around the axis area. The default is FRAME. If you also use a BUBBLE2 or PLOT2 statement and your plotting statements have conflicting frame specifications, FRAME is used.
For the frame color, a specification is searched for in this order:
  1. the CAXIS= option
  2. the COLOR= option in the AXIS definition assigned to the vertical axis
  3. the COLOR= option in the AXIS definition assigned to the horizontal axis
  4. the default, which is the color defined by the current style
To fill the axis area with a back wall color, use the CFRAME= option.
To fill the axis area with a back wall image, use the IFRAME= option.
Alias:FR | NOFR=
FRONTREF
specifies that reference lines drawn by the AUTOREF or REF= options should be drawn in front of the bars. By default, reference lines are drawn on the back plane of the axis.
GRID
draws reference lines at all major tick marks on both axes. You get the same result when you use all of these options in a BUBBLE statement: AUTOHREF, AUTOVREF, FRAME, LVREF=34, and LHREF=34. The line type for GRID is 34.
The line color is the color of the axis.
HTML=variable
identifies the variable in the input data set whose values create links or data tips or both. The variable values are either links or data tips or both that are created in the HTML file generated by the ODS statement. The links are URLs pointing to Web pages to display when the user clicks (drills down) on elements in the graph. Data tips are detailed information or data values that are displayed as pop-up text when a mouse pointer is positioned over elements in the graph.
Restriction:For Java and ActiveX, only the ACTXIMG device is supported for the BUBBLE2 statement.

Adding Links and Enhancements with the URL=, HTML=, and HTML_LEGEND= Options

LAUTOVREF=reference-line-type
specifies a line type for reference lines drawn at major tick marks on the vertical axis, as specified by the AUTOVREF option. The reference-line-type value can be a whole number from 1 to 46. A value of 1 specifies a solid line; values 2 through 46 specify dashed lines. The default line type is retrieved from the current style, or if the NOGSTYLE option is specified, the default value is 1, which draws a solid line.
Style reference:LineStyle attribute of the GraphGridLines element
LVREF=reference-line-type | (reference-line-type) | (reference-line-type-list)
specifies line types for reference lines drawn perpendicular to the vertical axis. The reference-line-type value can be a whole number from 1 to 46. A value of 1 specifies a solid line; values 2 through 46 specify dashed lines. This option affects reference lines drawn with the AUTOVREF, VREF, and GRID options. Specifying a single line type without parentheses applies that line type to all reference lines. The LAUTOVREF= option overrides the LVREF= option for lines drawn with the AUTOVREF option. Specifying a single line type in parentheses applies that line type only to the first line drawn by the VREF= option. Specifying a line-type list applies line types in sequence to successive reference lines drawn with the VREF= option. The syntax of the line type list requires parentheses and line types separated by spaces (type1 type2... typeN). The default line type is retrieved from the current style. If the NOGSTYLE option is specified, the default value is 1, which draws a solid line. To specify colors for these references lines, use the CVREF= option. To specify labels for these reference lines, use the VAXIS= option.
Alias:LV=
Style reference:LineStyle attribute of the GraphGridLines element
NOAXIS
suppresses the axes, including axis lines, axis labels, all major and minor tick marks, and tick mark values.
Alias:NOAXES
VAXIS=value-list | AXIS<1...99>
specifies the major tick mark values for the vertical axis or assigns an axis definition. For a description of the value-list see HAXIS=value-list | AXIS<1 . . . 99> for the PLOT statement. To assign labels to reference lines, specify an axis definition that contains the REFLABEL= option. The labels are applied in sequence to all reference lines defined with the AUTOVREF and VREF= options.
For Web output that is generated with a Java or ActiveX device driver, certain options of the AXIS statement are not supported. For details, see the AXIS Statement.
Restriction:Partially supported by Java and ActiveX
VMINOR=number-of-minor-ticks
specifies the number of minor tick marks that are drawn between each major tick mark on the vertical axis. Minor tick marks are not labeled. The VMINOR= option overrides the NUMBER= suboption of the MINOR= option in an AXIS definition. You must specify a positive number.
VREF=value | (value) | (value-list)
draws one or more reference lines perpendicular to the vertical axis at specified points. For a description of value-list see HAXIS=value-list | AXIS<1 . . . 99> for the PLOT statement. The LVREF=, CVREF=, and WVREF= options can be used to change the line types, colors, and widths of these reference lines, respectively. To specify labels for these reference lines, use the VAXIS= option.
VREVERSE
specifies that the order of the values on the vertical axis should be reversed.
VZERO
specifies that tick marks on the vertical axis begin in the first position with a zero. The VZERO request is ignored if the vertical variable either contains negative values or has been ordered with the VAXIS= option or the ORDER= option in an AXIS statement.
WAUTOVREF=reference-line-width
specifies the line width for all reference lines at major tick marks on the vertical axis as determined by the AUTOVREF option. Line widths are specified as whole numbers with the default value being 1. To specify a color for these reference lines, use the option CAUTOVREF=reference-line-color.
Style reference:LineThickness attribute of the GraphGridLines element
WVREF=reference-line-width | (reference-line-width) | (reference-line-width-list)
specifies line widths for reference lines as determined by the vertical axis. Line widths are specified as whole numbers. Specifying a line width without parentheses applies that type to all reference lines drawn with the AUTOVREF and VREF= options. Note that the WAUTOVREF= option overrides WVREF=reference-line-width for reference lines drawn with the AUTOREF option. Specifying a single line width in parentheses applies that line width to the first reference line drawn with the VREF= option. Specifying a line width list applies line widths in sequence to successive reference lines drawn with the VREF= option. The syntax of the line-width list requires parentheses and line widths separated by spaces (width1 width2 ...widthN). The default line width is specified by the current style or by the AXIS statement's WIDTH= option. (By default, WIDTH=1.) .To specify colors for these reference lines, use the option CVREF=reference-line-color | (reference-line-color) | (reference-line-color-list).
Style reference:LineThickness attribute of the GraphGridLines element

Details

Options

Options for the BUBBLE2 statement are identical to the options for the BUBBLE statement with exception of the following, which are ignored if specified:
  • AUTOHREF
  • CAUTOHREF=
  • CHREF=
  • DESCRIPTION=
  • HAXIS=
  • HMINOR=
  • HREF=
  • HZERO=
  • IFRAME=
  • IMAGESTYLE =
  • LAUTOHREF=
  • LHREF=
  • NAME=
  • WAUTOHREF=
  • WHREF=
See BUBBLE2 Statement for complete descriptions of options that you can use with the BUBBLE2 statement.

Description

The BUBBLE2 statement specifies one or more plot requests that name the horizontal and right vertical axis variables and the variable that controls the size of the bubbles. This statement automatically does the following:
  • scales the axes to include the maximum and minimum data values
  • labels each axis with the name of its variable or an associated label
  • displays each major tick mark value
  • draws circles for values that are located within the axes
You can use statement options to control right vertical axis scaling, draw reference lines on the right vertical axis, control the display of the bubbles, display an axis area color or image, and specify annotation.
In addition, you can use global statements to modify the axes (AXIS statement), and add text to the graph (TITLE, NOTE, and FOOTNOTE statements). You can also use the Annotate data set to enhance the plot.

Coordinating BUBBLE and BUBBLE2 Plot Requests

The BUBBLE2 statement draws circles only for values that are located within the axes. Bubbles are not drawn for values that lie outside of the axis range. If a bubble size value causes a bubble to overlap the axis, the bubble is clipped against the axis line.
In the BUBBLE2 statement, either the y-variable or bubble-size can differ from the variables in the BUBBLE statement. Here are some possible combinations of plot requests for BUBBLE and BUBBLE2 statement pairs and how they affect the plot:
  • The vertical axis variables Y and Y2 are different, but the bubble size variable, S, is the same in both:
    bubble y*x=s;
       bubble2 y2*x=s;
    These plot requests generate a plot in which both sets of bubbles have the same value (size) but different locations on the graph.
  • The vertical axis variables are the same, Y, but the bubble size variables, S and S2, are different:
    bubble y*x=s;
       bubble2 y*x=s2;
    The resulting plot has two identical vertical axes and two sets of concentric bubbles of different sizes.
  • Both the vertical axis variables, Y and Y2, and the bubble size variables, S and S2, are different:
    bubble y*x=s;
       bubble2 y2*x=s2;
    These plot requests produce the equivalent of an overlay plot in which two different sets of bubbles plotted against different vertical axes are displayed on the same graph.
The plot requests in the BUBBLE and BUBBLE2 statements must be evenly matched, for example:
bubble  y*x=s  b*a=c;
      bubble2 y2*x=s b2*a=c2;
These statements produce two graphs each with two vertical axes. The first pair of plot requests (Y*X=S and Y2*X=S) produce one graph in which the variable X is plotted on the horizontal axis, the variable Y is plotted on the left axis, and the variable Y2 is plotted on the right axis. In this pair, the value of S is the same for both requests. The second pair of plot requests (B*A=C and B2*A=C2) produce another graph in which the variable A is plotted on the horizontal axis, the variable B is plotted on the left axis, and the variable B2 is plotted on the right axis.
Any modifications to horizontal axes specifications must be identical for both statements. If they are different, the BUBBLE2 axis specification is ignored.
If the scale of values for the left and right vertical axes is the same and you want both axes to represent the same range of values, specify the range with a VAXIS= option in both the BUBBLE and BUBBLE2 statements.