Creates bubble plots in which a third variable is plotted against
two variables represented by the horizontal and vertical axes; the value of
the third variable controls the size of the bubble.
Requirements: |
At least one plot request
is required.
|
Global statements: |
AXIS, FOOTNOTE, TITLE
|
The BUBBLE statement specifies one or more plot requests that name the horizontal
and left vertical axis variables and the variable that controls the size of
the bubbles. This statement automatically
- centers each circle at a data point that is determined
by the values of the vertical and horizontal axes variables
- scales the axes to include the maximum and minimum
data values
- labels each axis with the name of its variable
or 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 axis scaling,
draw reference lines, modify the appearance of axes, control the display of
the bubbles, and specify annotation.
In addition, you can use global statements to modify
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.
BUBBLE plot-request(s)
</option(s)>;
|
option(s) can be one or more options
from any or all of the following categories:
- 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.
- y-variable
- variable plotted on the left vertical axis.
- x-variable
- variable plotted on the horizontal axis.
- bubble-size
- variable that dictates 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.
Options in a BUBBLE statement affect
all graphs
that are produced by that statement. You can specify as many options as you
want and list them in any order.
-
ANNOTATE=Annotate-data-set
ANNO=Annotate-data-set
- specifies a data set to annotate plots that
are produced by the BUBBLE statement.
-
AUTOHREF
- draws reference lines at all major tick
marks on the horizontal axis.
-
AUTOVREF
- draws reference lines at all major tick
marks on the vertical axis.
-
BCOLOR=bubble-color
- specifies the color for the bubbles. If
you omit the BCOLOR= option, the first color in the colors list is used for
the bubble color.
-
BFONT=font
- specifies the font to use for bubble labels.
See SAS/GRAPH Fonts
for details on how to specify font. If you omit the BFONT= option,
a font specification is searched for in this order:
- the FTEXT= option in a GOPTIONS statement
- the
default hardware font.
-
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 may collide with other bubbles or previously placed labels.
Labels display in the color specified by the CTEXT=
option. If you omit CTEXT=, the default is the first color in the colors
list.
-
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 will be twice the area of the
smaller bubble. If BSCALE=RADIUS, the radius of the larger bubble will be
twice the radius of the smaller bubble and the larger bubble will have more
than twice the area of the smaller bubble.
-
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.
-
CAXIS=axis-color
CA=axis-color
- specifies the color for the axis line and
all major and minor tick marks. By default, the procedure uses the first color
in the colors list.
If you use the CAXIS= option, it may be overridden by
- the COLOR= option in an AXIS definition,
which
in turn is overridden by
- the COLOR= suboption of the MAJOR= or MINOR= option
in an AXIS definition.
-
CFRAME=background-color
CFR=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.
-
CHREF=reference-line-color
CH=reference-line-color
- specifies the color for reference lines
that are requested by the HREF= and AUTOHREF options. By default, these reference
lines display in the color of the horizontal axis.
-
CTEXT=text-color
C=text-color
- specifies the color for all text on the
axes, including tick mark values, axis labels, and bubble labels.
If you omit the CTEXT= option, a color specification
is searched for in this order:
- the CTEXT= option in a GOPTIONS statement
- the default, the first color
in the colors list.
If you use the CTEXT= option, it overrides the color
specification for the axis label and the tick mark values in the COLOR= option
in an AXIS definition that is assigned to the axis.
If you use CTEXT=, the color specification is overridden
in this situation: if you also use the COLOR= suboption of a LABEL= or VALUE=
option in an AXIS definition that is assigned to the axis, that suboption
determines the color of the axis label or the color of the tick mark values,
respectively.
-
CVREF=reference-line-color
CV=reference-line-color
- specifies the color for reference lines
that are requested by the VREF= and AUTOVREF options. By default, these reference
lines display in the color of the vertical axis.
-
DESCRIPTION='entry-description'
DES='entry-description'
- specifies the description of the catalog
entry for the plot. The maximum length for entry-description
is 40 characters. The description does not appear on the plot. By default,
the procedure assigns a description of the form BUBBLE OF variable*variable=variable.
The entry-description can include the #BYLINE,
#BYVAL,
and #BYVAR substitution options, which work as they do when used on TITLE,
FOOTNOTE, and NOTE statements. For more information, refer to the description
of the options, and Substituting BY Line Values in a Text String.
The 40-character limit applies before the substitution takes place for these
options; thus, if in the SAS program the entry-description text exceeds 40
characters, it is truncated to 40 characters, and then the substitution is
performed.
The descriptive text is shown in the "description" portion of each of
the following:
- in the Results window
- among the catalog-entry properties that you can view from the
Explorer window
- in the Table of Contents that is generated when you use CONTENTS=
on an ODS HTML statement (see Linking to Output through a Table of Contents),
assuming the GPLOT output is generated while the contents page is open
- in the Description field of the PROC GREPLAY
window
-
FRAME | NOFRAME
FR | NOFR
- specifies whether a frame is drawn around
the axis area. The default is FRAME; however, if the V6COMP option is in effect
on the GOPTIONS statement, the default is NOFRAME. 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:
- the CAXIS= option
- the COLOR= option in the AXIS definition assigned
to the vertical axis
- the COLOR= option in the AXIS definition assigned
to the horizontal axis
- the default, the first color in the colors list.
To fill the axis area with a
background color, use the
CFRAME= option.
-
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.
-
HAXIS=value-list | AXIS<1
. . . 99>
- specifies major tick mark values for the
horizontal axis or assigns an AXIS definition. See the HAXIS option for
a description of value-list. If you assign an AXIS definition
that does not currently exist, the option is ignored. By default, the procedure
scales the axis and provides an appropriate number of tick marks.
Note: If data values fall outside of the range that is specified
by the HAXIS= option, then by default the outlying data values are not used
in interpolation calculations.
-
HMINOR=number-of-minor-ticks
HM=number-of-minor-ticks
- specifies the number of minor tick marks
that are drawn between each major tick mark on the horizontal axis. Minor
tick marks are not labeled. The HMINOR= option overrides the NUMBER= suboption
of the MINOR= option in an AXIS definition. You must specify a positive number.
-
HREF=value-list
- draws one or more reference lines perpendicular
to the horizontal axis at points that are specified by value-list.
See the HAXIS option for a description of value-list.
See also: |
CHREF= for a
description of color specifications for reference lines. |
-
HZERO
- specifies that tick marks on the horizontal
axis begin in the first position with a value of zero. The HZERO request is
ignored if negative values are present for the horizontal variable or if the
horizontal axis has been specified with the HAXIS= option.
-
LHREF=line-type
LH=line-type
- specifies the line type for drawing reference
lines that are requested by the AUTOHREF or HREF= option. Line-type can be 1 through 46. By default, LHREF=1, a solid line. See
Line Types
for examples of available line types.
-
LVREF=line-type
LV=line-type
- specifies the line type for drawing reference
lines that are requested by the AUTOVREF or VREF= option. Line-type can be 1 through 46. By default, LVREF=1, a solid line. See
Line Types
for examples of available line types.
- NAME='entry-name'
- specifies the name of the catalog entry
for the graph. The maximum length for entry-name is eight characters.
The default name is GPLOT. If the specified name duplicates the name of an
existing entry, SAS/GRAPH software
adds a number to the duplicate name to create a unique entry, for example,
GPLOT1.
-
NOAXIS
NOAXES
- suppresses the axes, including axis lines,
axis labels, all major and minor tick marks, and tick mark values.
-
VAXIS=value-list | AXIS<1...99>
- specifies the major tick mark values for
the vertical axis or assigns an AXIS definition. See the HAXIS option for
a description of value-list.
-
VMINOR=number-of-minor-ticks
VM=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. VMINOR= overrides the NUMBER= suboption of the MINOR=
option in an AXIS definition. You must specify a positive number.
-
VREF=value-list
- draws one or more reference lines perpendicular
to the vertical axis at points that are specified by value-list.
See the HAXIS option for a description of value-list.
See also: |
CVREF= for a
description of color specifications for reference lines. |
-
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.
The BUBBLE statement draws
circles only for values that are located within the axes. Observations with
values that lie outside of the axis area are not plotted. If a bubble size
value causes a bubble to overlap the axis, the bubble is clipped against the
axis line. The bubbles for the highest axis value and lowest axis value may
be clipped unless you modify the axes in either of the following ways:
- by offsetting the first and last values
- by
adding values to the range that is represented
by the axis.
Specify the range of values on an axis with the HAXIS=
or VAXIS= option, or with AXIS definitions.
To add a right vertical axis, use a BUBBLE2
statement.
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.